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
Improved sortable behavior #359
Conversation
@travisbot You're right, I will have to adjust and add tests too. Edit: Why does removeFromList() sets rank to null but there is no "AND SORTABLE_RANK IS NOT NULL" condition in any query? This behavior needs more solid concept. |
@rozwell travisbot is... a bot :p Your work seems ok, but I don't really know this behavior so.. let's see other comments, and try to fix the test suite. |
@willdurand I know ;) |
It looks fine to me, but as I said, I'm not expert on this. Maybe we should try to expose what the behavior should do, and how before to change everything. What do you think? |
I took one more look at this behavior and after my modifications we actually need to talk about those 2 things only:
|
I think you are changing the behavior of ... this behavior :)
Sorry for the delay, I tried to learn this behavior a bit more. |
…g merge conflicts)
@willdurand is there any reason to have boolean _use_scope_ parameter for scope, when you have to set _scope_column_ anyway? |
well, I think you can enable/disable the use of scopes easily. |
This PR needs unit tests that fail if the builder is not modified and passes otherwise - this will reveal the interest of tour modification. |
@fzaninotto can you explain with more details? |
…proach, little bugfix in preUpdate
…in SortableBehaviorObjectBuilderModifierWithScopeTest::testInsertAtRank())
Little summary of changes:
TODO: |
Seems ready to be merged. |
So |
ok, I'm +1. Good patch. |
@willdurand yes sir. |
Great, merged! Thank you so much. |
Can you port this PR on Propel2? :) |
Sure, but after I fix onDelete="setnull" issue. |
Changes:
It is now possible to use those methods in null scope (why not?).
See: native sorting in sfPropelORMPlugin admin generator
Now it moves object to the end of null scope
There are some other issues like when scope column is a FK and onDelete="setnull", removing related/scope object will only clean the scope value leaving ranks untouched.