You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I go to save a MySQL Exception is thrown (related to update/select from the same table). A full trace is at bottom of this ticket. Error is:
user_error(Couldn't run query: UPDATE "Album" SET "Sort" = SELECT MAX("Sort") + 1 FROM "Album") WHERE "ID" = 1
You can't specify target table 'Album' for update in FROM clause,256)
line 525 of MySQLDatabase.php
Another issue; If "Sort" is not a field on album, I get the following exception:
Uncaught Exception: Object->__call(): the method 'hasowntabledatabasefield' does not exist on 'ViewableData'
The goal of the module is to provide transparent drag-n-drop support so that component calls (Dataobject.getComponents|getManyManyComponents) are properly augmented without the developers explicitly setting the sort column. Admitetly I'm currently working out some kinks to make the transparency robust/reliable... but think I'll have them worked out soon.
Thanks!
Trace:
user_error(Couldn't run query:
UPDATE "Album" SET "Sort" =
SELECT MAX("Sort") + 1
FROM "Album")
WHERE "ID" = 1
You can't specify target table 'Album' for update in FROM clause,256)
line 525 of MySQLDatabase.php
MySQLDatabase->databaseError(Couldn't run query: UPDATE "Album" SET "Sort" = (SELECT MAX("Sort") + 1 FROM "Album") WHERE "ID" = 1 | You can't specify target table 'Album' for update in FROM clause,256)
line 123 of MySQLDatabase.php
MySQLDatabase->query(UPDATE "Album" SET "Sort" = (SELECT MAX("Sort") + 1 FROM "Album") WHERE "ID" = 1,256)
line 129 of DB.php
DB::query(UPDATE "Album" SET "Sort" = (SELECT MAX("Sort") + 1 FROM "Album") WHERE "ID" = 1)
line 122 of HasManyPickerField.php
HasManyPickerField->saveInto(Page)
line 1021 of Form.php
Form->saveInto(Page,1)
line 683 of LeftAndMain.php
LeftAndMain->save(Array,Form,SS_HTTPRequest)
line 329 of Form.php
Form->httpSubmission(SS_HTTPRequest)
line 143 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
line 161 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
line 282 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
line 125 of Director.php
Director::direct(/admin/EditForm)
line 127 of main.php
The text was updated successfully, but these errors were encountered:
I have a has_many relationship between Page and Album. This looks like:
...
When I go to save a MySQL Exception is thrown (related to update/select from the same table). A full trace is at bottom of this ticket. Error is:
user_error(Couldn't run query: UPDATE "Album" SET "Sort" = SELECT MAX("Sort") + 1 FROM "Album") WHERE "ID" = 1
Another issue; If "Sort" is not a field on album, I get the following exception:
Uncaught Exception: Object->__call(): the method 'hasowntabledatabasefield' does not exist on 'ViewableData'
I really like the simplicity of this module and am wondering if you think it worth my effort to extend the SortWeight (https://github.com/briceburg/silverstripe-sortweight) module to work with ItemSetField?
The goal of the module is to provide transparent drag-n-drop support so that component calls (Dataobject.getComponents|getManyManyComponents) are properly augmented without the developers explicitly setting the sort column. Admitetly I'm currently working out some kinks to make the transparency robust/reliable... but think I'll have them worked out soon.
Thanks!
Trace:
user_error(Couldn't run query:
UPDATE "Album" SET "Sort" =
SELECT MAX("Sort") + 1
FROM "Album")
WHERE "ID" = 1
The text was updated successfully, but these errors were encountered: