Project

General

Profile

Actions

Feature proposal #2444

closed

IF substitutions not using API to check values

Added by krileon about 13 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
21 March 2011
Due date:
% Done:

100%

Estimated time:
1:00 h

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

2444.patch (859 Bytes) 2444.patch krileon, 21 March 2011 16:12
2444-rev1.patch (977 Bytes) 2444-rev1.patch krileon, 21 March 2011 16:19
Actions #1

Updated by krileon about 13 years ago

  • 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.

Actions #2

Updated by krileon about 13 years ago

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.

Actions #3

Updated by beat almost 13 years ago

  • Target version set to CB 1.7
Actions #4

Updated by beat almost 13 years ago

  • 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.

Actions #5

Updated by beat over 12 years ago

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.

Actions

Also available in: Atom PDF