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) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Problem: undefined method CRM_Core_BAO_CustomField::isMultiRecordField()
Pages: [1]

Author Topic: Problem: undefined method CRM_Core_BAO_CustomField::isMultiRecordField()  (Read 442 times)

roblog

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 5.42
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Problem: undefined method CRM_Core_BAO_CustomField::isMultiRecordField()
January 08, 2015, 09:39:45 am
Hi I recently transferred a site onto my server, and upgraded to the latest versions of drupal and civi. I'm having problems with a number of existing custom fields, and with creating new ones. Profiles using the existing problematic fields gave me a white screen, which I was able to temporarily resolve by disabling the problematic fields (through a process of elimination).

Also when I try to add new custom fields I get the following in my apache error.log:
PHP Fatal error:  Call to undefined method CRM_Core_BAO_CustomField::isMultiRecordField() in /var/www/drupal/7/sites/all/modules/civicrm/CRM/UF/Form/Field.php on line 801, referer: http://..

If I comment out line 801 in Field.php, I am able to add new custom fields ok, but I'm not sure if this is wise or not. Here's an extract from the code:

        //check if profile already has a different multi-record custom set field configured
        $customGroupId = CRM_Core_BAO_CustomField::isMultiRecordField($profileFieldName);
        if ($customGroupId) {
          if ($profileMultiRecordCustomGid = CRM_Core_BAO_UFField::checkMultiRecordFieldExists($self->_gid)) {
            if ($customGroupId != $profileMultiRecordCustomGid) {
              $errors['field_name'] = ts("You cannot configure multi-record custom fields belonging to different custom sets in one profile");
            }
          }
        }

Any advice on how to fix this properly??

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Problem: undefined method CRM_Core_BAO_CustomField::isMultiRecordField()
January 08, 2015, 03:41:50 pm
I think here's the answer:
Quote
$errors['field_name'] = ts("You cannot configure multi-record custom fields belonging to different custom sets in one profile

Find which Profiles have this problem, and remove one or more custom fields (that allow multiple values) from that profile.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

roblog

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 5.42
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Problem: undefined method CRM_Core_BAO_CustomField::isMultiRecordField()
January 09, 2015, 03:29:06 am
Hi, thanks for the suggestion, but I think not. The code crashed at line 801, which is
$customGroupId = CRM_Core_BAO_CustomField::isMultiRecordField($profileFieldName);

The CRM_Core_BAO_CustomField::isMultiRecordField($profileFieldName) method is undefined, indicating either that this is a bit of legacy code that should be removed, or that there is something missing somewhere else.



roblog

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 5.42
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Problem: undefined method CRM_Core_BAO_CustomField::isMultiRecordField()
January 09, 2015, 05:20:10 am
OK here's an interesting thing. On the settings page for a custom field data set the check box next to  'Does this Custom Field Set allow multiple records?' is broken. However, when I create a new custom field data set the checkbox is intact, and when I check or uncheck it the value is saved properly.

Any advice anyone?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Problem: undefined method CRM_Core_BAO_CustomField::isMultiRecordField()

This forum was archived on 2017-11-26.