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

When default search profile is set, creating PDF letter activity is assigned to incorrect activity id

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.6
    • Fix Version/s: 4.3.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      In CRM/Contact/Form/Search.php, around line 618 in the preProcess() function there is:

      if ($this->_ufGroupID == NULL &&
      $config->defaultSearchProfileID != NULL
      )

      { $this->_ufGroupID = $config->defaultSearchProfileID; }

      That clause matches if you have set a defaultSearchProfileID.

      Later in that function, we have:

      if (!empty($this->_ufGroupID))

      { $this->set('id', $this->_ufGroupID); }

      Therefore, if $config->defaultSearchProfileID is not null, then the form's id value is set to the id of the default search profile.

      Then, in CRM/Contact/Form/Task/PDF.php, around line 69 in the preProcess function we have:

      $this->_activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);

      The result, is that the PDF activity created has the activityId matching the profile id of the default search profile.

      The result is one of two things:

      The activity should be a PDF Letter, but it has the subject line: "Subject for Membership Signup". that's because it was attached to the activity with ID 1 (which is the profile ID of Name and Address, which is the profile I set as the default search profile).

      I'm fairly lost in the process - not sure exactly which code is wrong??

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              jamie Jamie McClelland
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: