Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-11443

CRM_Core_BAO_Setting::setItem() followed by getItem() returns wrong result

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      Calling CRM_Core_BAO_Setting::setItem() to set something and then calling getItem right after seems to return the value from before you set it, not the new one. To reproduce, create a simple unit test where all within the same function you just do:

      $mailingBackend = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
      'mailing_backend'
      );
      $mailingBackend['outBound_option'] = 2;
      CRM_Core_BAO_Setting::setItem($mailingBackend,
      CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
      'mailing_backend'
      );

      Then call getItem again and compare the results.

        Attachments

          Activity

            People

            • Assignee:
              demeritcowboy Dave D
              Reporter:
              demeritcowboy Dave D
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: