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
Small question about using a position field, is there any solution to use a position field starting at 1 rather than 0?
I know it can seems strange but I need to use a position which start at 1 and I can’t find a suitable solution to update the position field without overriding the after_* and before_* events 🤔
Thanks for the feedback 🙂
The text was updated successfully, but these errors were encountered:
@Guikingone , have you found a solution. I checked the source code and the function that actually writes the positions (doRewritePositions()) is called after the callbacks. So overwriting after_add doesn't seem to help.
What could help is an extra option named "first_position: 1" and use it in doRewritePositions
I made a fork and added and extra option named position_field_first_value. If you still need it feel free to change the vcs source in composer.json to https://github.com/stevro/symfony-collection
I've found a solution by overriding the after_* event and lopping through every items which is handled for the position attribute and setting the value to the actuel key of the array (parseInt(value + 1)), that's clearly not the best solution but it seems to work 🙂
Hi everyone 👋
Small question about using a position field, is there any solution to use a position field starting at 1 rather than 0?
I know it can seems strange but I need to use a position which start at 1 and I can’t find a suitable solution to update the position field without overriding the
after_*
andbefore_*
events 🤔Thanks for the feedback 🙂
The text was updated successfully, but these errors were encountered: