Feature proposal #2444
closed
IF substitutions not using API to check values
Added by krileon over 13 years ago.
Updated over 13 years ago.
Description
For instance if you're using CB Query Field and and if statement of cb_query="1" then cb_query will always be null due to not existing in user object as it's dynamically generated and can only be gotten through getField API. The IF statements should be using getField (the CBuser class object is provided anyway) with the output as PHP so integrations such as CB Query Field will provide results to compare against.
Files
- File 2444.patch 2444.patch added
- Status changed from New to Resolved
- Assignee changed from krileon to beat
- % Done changed from 0 to 100
Using getField with output as php and if returned result is an array to shift off the first value. Only 1 value is provided as php output gives array( $name => $value ). This results in an API driven raw value.
Rev1 offers a backup. If getField doesn't return a value then it'll check if a value exists directly in user object (first checking if that field is even in the user object). This ensures the IF statement trys its best to get the field value as API driven allows a plugin or privacy for example to result in an empty value. Recommending Rev1.
- Target version set to CB 1.7
- Status changed from Resolved to Closed
- Estimated time set to 1:00 h
Implemented in r1524 slightly differently than proposed, and using a new API parameter for getField() method, allowing to access all fields, irrespectively of not-on-profile or other settings, which makes sense in an admin-provided if-statement.
CB 1.7 RC regression bug: [NAME] was not substituted anymore with first+last name
r1540 and r1541 fixes regression of r1524, r1525 and r1528 for bug #2444 and bug #2445 as uppercase [NAME] was not substituted anymore with first+last name, as the field is unpublished and the user-object entry is lowercase.
Also available in: Atom
PDF