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

$contactname undefined in Contact/BAO/ContactType.php

    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

      When accessing a create contacttype form the api. I get a notice for undefined variables.
      To be precise it get's stuck on the next piece of code.
      Rules 605-615 from CRM/Contact/BAO/ContactType

      if ($contactType->find(TRUE))

      { $contactName = $contactType->name; $contact = ucfirst($contactType->label); $active = $contactType->is_active; }

      if (CRM_Utils_Array::value('id', $params)) {
      $params = array('name' => "New $contactName");
      $newParams = array(
      'label' => "New $contact",
      'is_active' => $active,
      );

      When the result of $contactType->find(TRUE) is false, the variables $contactName, $contact and $active are never set. Which results in the undefined.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              mallezie Tim Mallezie
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: