Delete doesn't work with a tablename using the alias. Alias is required for server-side processing.

Delete doesn't work with a tablename using the alias. Alias is required for server-side processing.

js123456789js123456789 Posts: 1Questions: 0Answers: 0

IMHO there is a bug in the _remove_tables method of Editor leading to an issue when deleting a row from the aliased table. If an alias is set used " as " word Editor object stores the tablename in a row of the $_table array. But the problem is that it's store "as it is".

Example: Editor::inst( "test", "test_Table as test_alias", array("a","b", "c") );
object that will be create will have
_table as array of [0] => "test_Table as test_alias".

When trying to delete the row _remove_table method is called and it tried to look for a tablename of the row being deleted in the _table. It fails because table name that comes from dbField is alreaty aliased and shows test_alias that doesn't match _table[0].

Has anyone met the same issue?

KR
Jacek

Replies

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Hi Jacek,

    Apologies for having lost your question amoung my sea of tabs! You are correct, this is a limitation of the aliasing support at the moment. I've just tried experimenting with it a bit, but the compound key aspect makes this frustratingly difficult to fix.

    At the moment I'm afraid it would be a case of not using an alias.

    Regards,
    Allan

This discussion has been closed.