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

Limitations on civicrm_pre hook

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.11
    • Fix Version/s: 4.4.12, 4.6
    • Component/s: None
    • Labels:
      None
    • Documentation Required?:
      Developer Doc

      Description

      I have been looking at implementing the following using the pre hook and have found it is currently impossible to alter the id of the membership being altered

      Background:
      The purpose of the specific work I'm doing is to accurately show the gap between memberships where there is one. This has been an ongoing 'sticking point' because the default behaviour (extend the expired membership and attempt to demonstrate what has happened by altering the start_date but not the join_date) only suits some organisations.

      Issue
      The code needs to
      1) check if the membership status is expired (or other non-renewable statuses)
      2) if so, unset the id of the membership being altered and edit the start_date & join_date to today

      The problem is with #2 - currently $id is passed into the pre hook as a non-reference field. $params['id'] can be altered but the alteration is ignored.

      I have a patch that 'gets us past this' which I will attach but we should probably get the pattern right. If it involves passing the $id by reference create calls (currently passing NULL) will need to be altered to pass a variable.

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: