I just put in a pull request to make 2 simple changes to the dbj element plugin and fix a long-standing bug.
The problem was happening when the WHERE condition could also possibly change the number of options in the dropdown - i.e. when the AJAX update option was also being used - then the descriptions would become out-of-sync.
This was happening because the class name that was being created (to allow js to link the selected option to the description) was based on the original selectedIndex (index sequence order).
I changed one line of code in both the databasejoin layout and javascript files so that the class name now uses the (primary key) value instead of the selectedIndex and all is well.
Unless someone can come up with a reason this might break something elsewhere, I'm hoping to get this pull request committed before the next time I have to update from Github.
The problem was happening when the WHERE condition could also possibly change the number of options in the dropdown - i.e. when the AJAX update option was also being used - then the descriptions would become out-of-sync.
This was happening because the class name that was being created (to allow js to link the selected option to the description) was based on the original selectedIndex (index sequence order).
I changed one line of code in both the databasejoin layout and javascript files so that the class name now uses the (primary key) value instead of the selectedIndex and all is well.
Unless someone can come up with a reason this might break something elsewhere, I'm hoping to get this pull request committed before the next time I have to update from Github.