Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update README.md #17

Closed
wants to merge 1 commit into from

2 participants

Matthias Schelling Ed Chipman
Matthias Schelling

added comment on missing 'SortOrder' field after migrating from SortableDataObject

Matthias Schelling schellmax Update README.md
added comment on missing 'SortOrder' field after migrating from SortableDataObject
e5ca21c
Ed Chipman

The reason I didn't mention this is because it is wrong for many_many relationships. That's why I mention "For migrations from 2.4 with SortableDataObject you need to setup your DataObject based on the instructions above however you must name your sort column "SortOrder" to maintain your sort indexes defined by SortableDataObject."

Matthias Schelling

alright, i get it now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 23, 2012
  1. Matthias Schelling

    Update README.md

    schellmax authored
    added comment on missing 'SortOrder' field after migrating from SortableDataObject
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 0 deletions.
  1. +7 −0 README.md
7 README.md
View
@@ -38,6 +38,13 @@ SortableGridField is not the same as SortableDataObject, since it is only a comp
UPDATE YourTable SET SortOrder=SortOrder+1;
```
+It's also important to add the 'SortOrder' field to the $db array of any sortable classes, as this was defined in the SortableDataObject decorator before:
+
+```php
+static $db = array(
+ 'SortOrder' => 'Int'
+);
+```
## @TODO
* Optimize re-ordering of a has_many relationship when sorting on a single page
Something went wrong with that request. Please try again.