[ic] table-editor tag and item_id with autonumber table

JT Justman jt at airdelights.com
Tue Nov 8 11:23:10 EST 2005

Peter wrote:
> On 11/07/2005 01:38 PM, JT Justman wrote:
>> I can create a new entry on an autonumber column with:
>> [table-editor key="" table="site_content"]
>> The problem is that the "Items" group uses $CGI->{item_id} to track the
>> current product sku, and if there is a value in $CGI->{item_id} then
>> [table-editor] treats that as the code to edit, and we end up creating a
>> row with the number of the current item sku when we thought we were
>> autonumbering.
> You should be able to force autonumbering with (untested and not sure):
> [table-editor key="[counter products/site_content.autonumber]"
> table="site_content"]

Well, [counter] does give me a unique number, but it's not related to
the mysql auto_increment. It may be a passable workaround for this
table, since it's only edited from the UI, but I may change that some day...

> You can also do: [cgi name=item_id set="" hide=1]
> ...or (even better because it actually removes the cgi value rather than
> just setting it to the empty string)...
> [perl]delete $CGI->{item_id}; '';[/perl]
> To manually clear out the item_id if it helps.

Clearing item_id does fix the autonumber issue, but it breaks the Item menu.


More information about the interchange-users mailing list