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

CRM_Core_BAO_CustomValueTable::setValues fails for 'Memo' fields

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.2, 3.2.1, 3.2.2
    • Fix Version/s: 3.2.3
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      [Copied from this forum post: http://forum.civicrm.org/index.php?topic=15306]

      When using CRM_Core_BAO_CustomValueTable::setValues to save a custom value of type Memo (a.k.a. Note / TextArea), this backtrace is produced:

      /var/www/domains/civicrm/dev/drupal/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 257
      /var/www/domains/civicrm/dev/drupal/sites/all/modules/civicrm/CRM/Utils/Type.php, fatal, 167
      /var/www/domains/civicrm/dev/drupal/sites/all/modules/civicrm/CRM/Core/BAO/CustomValueTable.php, escape, 494
      /var/www/domains/civicrm/dev/drupal/sites/all/modules/tmcivi/TM/Raw/Raw/saveParticipantGroundTransportationData.php, setValues, 79
      /var/www/domains/civicrm/dev/drupal/sites/all/modules/tmcivi/TM/Raw/Page.php, include, 48
      /var/www/domains/civicrm/dev/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 215
      /var/www/domains/civicrm/dev/drupal/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 350
      , civicrm_invoke,
      /var/www/domains/civicrm/dev/drupal/includes/menu.inc, call_user_func_array, 348
      /var/www/domains/civicrm/dev/drupal/index.php, menu_execute_active_handler, 18

      With the error message:
      unrecoverable error
      Sorry. A non-recoverable error has occurred.

      Cannot recognize Memo for

      Apparently CRM_Utils_Type::escape() is not built to handle the Memo type, and so it errors out as the default response.

      The attached patch fixes this problem by treating Memo in the same way as String. I am not sure if this is the best fix, but since a memo column is string data, it seems to be right.

        Attachments

          Activity

            People

            • Assignee:
              neha.saraph Neha Kulkarni
              Reporter:
              allenshaw Allen Shaw
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: