Issue using multiple list options with "get options from MySQL query" with advanced filter refresh

6 posts by 2 authors in: Forums > CMS Builder
Last Post: February 12, 2013   (RSS)

By Steve99 - February 9, 2013

Hello,

I'm experiencing an issue in the admin area of CMS Builder with multiple list options using "get options from MySQL query" with advanced filter refresh.

In Brief:

My goal is to have two drop down lists populated based on selection from a key drop down list. The issue is using "get options from MySQL query" with advanced filter refresh for multiple drop down lists isn't working.

Detailed Scenario:

I have two drop down lists set up this way that are supposed to populate based on selection from a key drop down list. The first dependent drop down list displays "Loading..." every single time and the second drop down list does get populated... However, sometimes the second drop down list is populated with the proper information and sometimes it is populated with the values that are supposed to be in the first one...

For troubleshooting, I deleted one of the two dependent fields and the remaining one populated properly. I then switched it to the query that was used for the drop down list that was temporarily removed and that also populated properly. I also put everything back the way it was and added a third drop down list set up this way that ended up being populated (with mixed results as described above) and the first and second lists were displaying "Loading...". My findings indicate that the last drop down list set up this way will be the only one that ends up being populated - however, the values will either be proper or they will be the values that were supposed to appear in either the first or second drop down list...

Any help with this would be greatly appreciated. It seems like a CMSB issue, but perhaps it's something else. Thanks in advance.

By Dave - February 9, 2013

Hi Steve, 

Thanks for the report.  First up, are you running a recent version?  We made some improvements to how those fields work a few versions ago.  If you're not running a recent version, try upgrading.

If that doesn't solve it, feel free to email CMS & FTP login details to me at dave@interactivetools.com along with steps to reproduce and I can take a look.  Note: Don't post login details to the forum.

Hope that helps!  Let me know how it goes.

Dave Edis - Senior Developer
interactivetools.com

Hi Dave,

I upgraded to CMSB 2.51 and the issue remains. I'll be in contact via email with info. Thanks.

Steve

By Dave - February 11, 2013

Hi Steve, 

We've had the occasional odd reports related to this over the years.  I did a fair bit of research on this again today and wasn't able to find anything conclusive.  As best as I can tell it's something to do with how jquery is updating the browser content.  The correct content is returned to the browser, and when I debug it and add some javascript to log the content of that field it actually reports it as being updated even though it doesn't show that way in the browser view.

Anyways, I commented some previous debug code that works around it in: /lib/menus/default/edit_functions.js - updateListFieldOptions()

  $.ajax({
    async: false, 

Adding or uncommenting that setting causes the browser to update the fields correctly by waiting for one field to be updated before attempting to update the next one.  The one difference is it will lock the browser while loading the new values, usually just for a fraction of a second, though.

Can you give that a try and let me know how it works for you?  I'll add this code the codebase for 2.52.

Let me know any questions or additional issues.  Thanks!

Dave Edis - Senior Developer
interactivetools.com

Hi Dave,

That took care of it. All is well. Thank you very much!

- Steve