[originally posted on Symfony forum but no (proper) answer has been given yet].
Has anyone ever managed to put Sortable behavior using csDoctrineActAsSortablePlugin on any model having i18n fields? Everything is installed fine but when trying to doctrine:data-load a fixtures file for the i18n model, it crashes by a MySQL integrity constraint violation about duplicate key entry. Is special handling required for i18n models?
My plugin version is 1.5.4.1 installed on symfony 1.4.8.
Apart from this, do you know of any other solutions (plugins) for adding "moveup" "movedown" functionality in the admin generator?
I've found a better workaround that the one originally posted on symfony forum.
In your schema.yml
comment the Sortable
behavior to all of your models and place an equivalent position
column instead of this (this is the actual column that will be created by the plugin in the database for the specified model) with the following properties:
position: { type: integer, notnull: false }
Run symfony doctrine:build --all --and-load --no-confirmation
. This will correctly insert all the data in the database.
Restore your schema.yml
and run symfony doctrine:build --all-classes --model --forms --filters
. This will restore the Sortable
behavior in your models without affecting your data.