First of all, congratulations for the great piece of software that is GroceryCRUD. I love the architecture simplicity and flexibility.
I'm having the following problem:
I'm working on the form to add a musical project.
The "project" table has an n-to-n relationship with the "musician" table, materialized on the relationship table "musicianinproject".
On grocery crud I use the following:
$crud->set_relation_n_n('musicians', 'musicianinproject', 'musician', 'project_id', 'musician_id', 'name', 'priority');
This is working well and if I have a priority manually defined on the database records the musician list is displayed correctly.
However, when I try to add a project via Grocery Crud, although I am able to select the musicians and order them on the multiselect interface, when I hit Save to submit the form, musicians array on the post array comes with the wrong order, and are thus written to the database with the wrong priority.
I read through the source code and investigated the issue and the most relevant information I got is on the post below, that relates to the same issue on the jQuery multiselect:
It seems that, since the source of the post data is a <select> element, there is no guarantee about the order of the selected options that will be sent by the browser.
If necessary I can post the code and logs on the server side showing the post data, but I will probably need to change the code to strip it of extra code irrelevant to this problem.
Thanks in advance for any help on this,