Bug in v2.14

8 posts by 3 authors in: Forums > CMS Builder
Last Post: March 2, 2012   (RSS)

By nmsinc - February 6, 2012

I'm working a new web site using v2.14 and have a problem with using the "List Options sql query (advanced)" option when populating two field list options with the same field refresh - using the code below in v2.13 it works perfect - in v2.14 the first field continues the load process for ever while the second loads perfect. I also tested the load by moving field two up to one using DragOderSort and received the same results!

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
nmsinc

Re: [nmsinc] Bug in v2.14

By (Deleted User) - February 7, 2012

Hi nmsinc,

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

Hi Tom,

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
nmsinc

Re: [nmsinc] Bug in v2.14

By (Deleted User) - February 7, 2012

Hi all,

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 nmsinc - February 29, 2012

I ran into this issue again on an upgrade with another customer to 2.14 - can you let me know what corrections you made?

Thanks - nmsinc
nmsinc

Re: [nmsinc] Bug in v2.14

By Jason - March 2, 2012

Hi,

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/
Attachments:

edit_functions_001.js 12K

Re: [Jason] Bug in v2.14

By nmsinc - March 2, 2012

Thanks for the update and help - have a great weekend!

nmsinc
nmsinc