Bug in v2.14
8 posts by 3 authors in: Forums > CMS Builder
Last Post: March 2, 2012 (RSS)
By nmsinc - February 6, 2012
See code below:
First Field: Load only Dispatcher or Dispatcher/Deputy/Officer
SELECT num, fullname FROM `<?php echo $TABLE_PREFIX ?>accounts` WHERE `agency` = '<?php echo $ESCAPED_FILTER_VALUE ?>' AND user_type IN('Dispatcher', 'Dispatcher/Deputy/Officer')
Second Field: Load only Deputy/Officer or Dispatcher/Deputy/Officer
SELECT num, fullname FROM `<?php echo $TABLE_PREFIX ?>accounts` WHERE `agency` = '<?php echo $ESCAPED_FILTER_VALUE ?>' AND user_type IN('Deputy/Officer', 'Dispatcher/Deputy/Officer')
Any help? Thanks - nmsinc
Re: [nmsinc] Bug in v2.14
By (Deleted User) - February 7, 2012
Which fields are populated with these queries? I'll run a check on our local version and see what I can find.
Thanks,
Tom
Re: [Tom P] Bug in v2.14
By nmsinc - February 7, 2012
This is a new site (not the one you and I have been working on lately) although the same format. Send me a quick email and I will provide CMS address!
Thanks - nmsinc
Re: [nmsinc] Bug in v2.14
By (Deleted User) - February 7, 2012
This is just an update to explain what nmsinc found:
When setting a pulldown field to use values generated by an sql query that update dependent on another field in that view, the values were not being returned by the query or the query would not complete (and you would always see the 'loading...' placeholder).
Here's a bit about what advanced pulldowns are good for:
Advanced pulldowns are a great way to add features to CMSB records and, when coupled with the right SQL, can help make a lot of tasks a lot easier.
Using the 'update on change' option means that when the selected field is updated (the field on which we are waiting for information), an Ajax request is sent to re-populate the dependent field(s) with the appropriately filtered/retrieved values.
So, if you have three tables (say accounts - individuals with their contact info and a field called Company which populates from the Companies table, Companies - all the details of a company, Payments - which has a field Company that populates from the Company table and Users which uses an advanced sql query to populate).
You want the Payments view to allow you to choose a 'Company' and then a user from that company. Set the 'Users' field to be an advanced pulldown using a MySQL query, set the update on change field to 'Company'. When the 'create' form is opened, there will initially be no options in the 'Users' pulldown but, once 'Company' is selected, all users who are from that 'Company' will be displayed as options in the pulldown.
Tom
Re: [Tom P] Bug in v2.14
By (Deleted User) - February 8, 2012
The problem was solved!
It required a minor change to the Ajax that runs the advanced pulldown query which will be rolled out in the next release.
Tom
Re: [Tom P] Bug in v2.14
By nmsinc - February 29, 2012
Thanks - nmsinc
Re: [nmsinc] Bug in v2.14
By Jason - March 2, 2012
The changes were made in the file cmsAdmin/lib/menus/default/edit_functions.js
I've attached a copy of the new file that will come with the next release of CMS Builder (v. 2.15). You should be able to use this now on your 2.14 installation to solve this issue. Make sure you do a backup of everything first, just in case you run into an issue.
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Bug in v2.14
By nmsinc - March 2, 2012
nmsinc