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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Get the membership_id in hook_civicrm_postProcess?
Pages: [1]

Author Topic: Get the membership_id in hook_civicrm_postProcess?  (Read 644 times)

lolas

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 9
    • Freeform Solutions
  • CiviCRM version: Several
  • CMS version: Drupal
  • MySQL version: 5.1+
  • PHP version: Several
Get the membership_id in hook_civicrm_postProcess?
June 18, 2013, 12:50:50 pm
I was working on something where it would be great to get the membershipId in the postprocess hook. I can't seem to find it in $form.

I see from this topic http://forum.civicrm.org/index.php/topic,28746#msg123098 that in the master branch right now that Lobo has committed a really helpful patch to get the contributionId.

I think it would be great someone could do the same for membershipId. If that has to be me then if I was to copy the idea in the patch posted in the above topic and apply it to $form->_membershipId then would that patch would be useful?
Freeform Solutions provides technology and management consulting, website and database development, and managed internet hosting solutions for not-for-profit organizations (NFPs).

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Get the membership_id in hook_civicrm_postProcess?
June 19, 2013, 12:03:52 am
Is there a specific reason you are using the postProcess hook rather than the post hook? From which form are you coming?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

lolas

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 9
    • Freeform Solutions
  • CiviCRM version: Several
  • CMS version: Drupal
  • MySQL version: 5.1+
  • PHP version: Several
Re: Get the membership_id in hook_civicrm_postProcess?
June 19, 2013, 06:23:27 am
I am using postProcess because I have injected some extra fields into the form in civicrm_buildForm and I want to associate these fields with the membership. I am pretty sure these fields will be gone by the time I get to the post hook although I haven't tried.

For now I am doing this on CRM_Member_Form_Membership and CRM_Member_Form_MembershipRenewal.
Freeform Solutions provides technology and management consulting, website and database development, and managed internet hosting solutions for not-for-profit organizations (NFPs).

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Get the membership_id in hook_civicrm_postProcess?
June 19, 2013, 09:28:30 am
Makes sense, I would use the postProcess hook too in that case :-). I will give it a go in my environment, see what I can spy
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Get the membership_id in hook_civicrm_postProcess?

This forum was archived on 2017-11-26.