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) »
  • bug and patch: CRM_Core_BAO_CustomValueTable::setValues fails for 'Memo' fields
Pages: [1]

Author Topic: bug and patch: CRM_Core_BAO_CustomValueTable::setValues fails for 'Memo' fields  (Read 1183 times)

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
bug and patch: CRM_Core_BAO_CustomValueTable::setValues fails for 'Memo' fields
August 24, 2010, 07:59:41 pm
When using CRM_Core_BAO_CustomValueTable::setValues to save a custom value of type Memo (a.k.a. Note / TextArea), this backtrace is produced:
Code: [Select]
/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.

- TM
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: bug and patch: CRM_Core_BAO_CustomValueTable::setValues fails for 'Memo' fields
August 24, 2010, 08:28:04 pm

can u file an issue and attach this patch please :)

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: bug and patch: CRM_Core_BAO_CustomValueTable::setValues fails for 'Memo' fields
August 24, 2010, 09:21:09 pm
Okay, done.
http://issues.civicrm.org/jira/browse/CRM-6727
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • bug and patch: CRM_Core_BAO_CustomValueTable::setValues fails for 'Memo' fields

This forum was archived on 2017-11-26.