CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Possible bug in CRM_Core_BAO_CustomGroup::formatCustomValues
Pages: [1]

Author Topic: Possible bug in CRM_Core_BAO_CustomGroup::formatCustomValues  (Read 856 times)

dpolant

  • I’m new here
  • *
  • Posts: 7
  • Karma: 1
Possible bug in CRM_Core_BAO_CustomGroup::formatCustomValues
December 21, 2010, 10:00:20 am
On one of our sites, some custom data was not showing up on the summary tab of the user contact page. I stepped through the code and found the problem inside CRM_Core_BAO_CustomGroup::formatCustomValues.

Code: [Select]
       
case 'Money':
            if ($htmlType == 'Text') {
                require_once 'CRM/Utils/Money.php';
                $retValue = CRM_Utils_Money::format($value, null, '%a');
                break;
            }

I have a money field that is a radio group. When I comment out the conditional here, the data gets loaded into smarty and displayed correctly. Additionally, I looked further down the page at the default: case. This searches the $customValue array for a match with the permitted set of options. I think this is where the radio button case is supposed to be handled. However it is failing to find a match when it is comparing my radio group because one of the sides is not converted to money format in the comparison.

I attached a patch that seems to solve the problem. I'm posting this in the forums before I add it as an issue. Patch is a .txt so that the uploader will allow it.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Possible bug in CRM_Core_BAO_CustomGroup::formatCustomValues
December 22, 2010, 12:35:30 am
Thanks, appreciated!
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Possible bug in CRM_Core_BAO_CustomGroup::formatCustomValues

This forum was archived on 2017-11-26.