-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid SQL query when reordering items via GridFieldOrderableRows for the first time #241
Comments
bump |
@michalkleiner @mak001 either of you want to create a PR? |
I may have some time as we will potentially need it for the coming project. |
It depends on versioning status. If models being ordered are versioned the component uses the ORM - I imagine that in this case things should be safe (completely unverified; thinking out loud). However if items are not versioned, and are not Still, could we worth trying @michalkleiner :) Never hurts to get an extra set of eyes on a PR anyway :P |
We've done a bunch of work on reordering with this component lately, including with around many many through lists and getting the correct sort column in these and has many lists. If the issue persists, feel free to reopen this issue. |
I think this is still valid. I'll leave it closed, but have assigned myself as a reminder to check. |
The problem is in https://github.com/symbiote/silverstripe-gridfieldextensions/blob/master/src/GridFieldOrderableRows.php#L564
The $baseTable is not correctly derived from the list (using the name of the db table as the input) and therefore it assumes the table holding the Sort column also holds the LastEdited column (which is then offending in the SQL).
This can be replicated by installing standard SilverStripe CMS recipe, adding "dnadesign/silverstripe-elemental": "2.x-dev", "dynamic/silverstripe-elemental-blocks": "dev-master" and creating and reordering Accordion Panels inside the Accordion block.
It only happens for the first time when the records don't have any Sort value assigned.
The text was updated successfully, but these errors were encountered: