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

Custom fields on non-contact entities do not appear in event confirmation emails

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.7.3
    • Fix Version/s: Unscheduled
    • Component/s: CiviEvent
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      This doesn't sound major, but it could have repercussions elsewhere.

      Our use case is a custom field attached to the 'address' entity, and exposed via a profile on the event booking form.

      On the confirmation screen the custom field value displays correctly, and it is saved correctly to the contact record. However, it is not displayed in the confirmation email due, and we hit the following error:

      Notice: Undefined property: CRM_Core_DAO::$1-address_custom_14 in CRM_Core_BAO_UFGroup::getValues() (line 1280 of C:\xampp\htdocs\civi\sites\all\modules\civicrm\CRM\Core\BAO\UFGroup.php).

      It's looking for Home-address_custom_14 in the DAO, but it should be looking for Home-custom_14.

      Backtrace (by hand)...
      It's called from Event_BAO_Event::buildCustomDisplay
      Which populates the list of $fields to lookup using Core_BAO_UFGroup::getFields

      So there seems to be a disconnect between the $fields fetched by:
      Core_BAO_UFGroup::getFields

      And the $fields that are expected by:
      Core_BAO_UFGroup::getValues

      At least when handling custom fields on entities other than 'contact'.

      The code around this area all looks really really nasty, so I'm loathe to try much here in fear of breaking something elsewhere...

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              john John K.
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: