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) »
  • Support »
  • Pre-installation Questions (Moderator: Dave Greenberg) »
  • CiviCRM and a complex group structure - will it work?
Pages: 1 2 3 [4]

Author Topic: CiviCRM and a complex group structure - will it work?  (Read 8763 times)

PRedmond

  • I’m new here
  • *
  • Posts: 21
  • Karma: 0
Re: CiviCRM and a complex group structure - will it work?
July 21, 2010, 05:34:31 am
Actually I get
Code: [Select]
Parse error: syntax error, unexpected T_STRING in /home/humanmil/public_html/drupal/sites/all/modules/membershipRenewal/membershipRenewal.module on line 19
Nevermind...

So, there are 2 date variables in the CRM_Contribute_Form_Contribution_Main Object - 'start_date' and 'created_date'. I can modify the variables, but the membership still starts from the current date. Is it possible that somewhere it uses now() (or similar) to get the start date?


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviCRM and a complex group structure - will it work?
July 22, 2010, 09:42:34 am
I think you'll have to follow the flow in the code to see how this happens:

CRM/Contribute/Form/Contribution/Confirm.php line 513 (in v3.2) which calls
CRM_Member_BAO_Membership::postProcessMembership which uses
CRM_Member_BAO_Membership::renewMembership to handle renewal logic

... given that there are several layers of function calls involved, I'm not sure how or even if you can use the postProcess hook to do what you want ?? Lobo or others might have a better idea on that.
Protect your investment in CiviCRM by  becoming a Member!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM and a complex group structure - will it work?
July 22, 2010, 09:52:15 am

the postProcess hook is called AFTER civicrm has done its work, so at that point its a bit too late :(

u'll have to go in and fix the DB records in your hook implementation

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

PRedmond

  • I’m new here
  • *
  • Posts: 21
  • Karma: 0
Re: CiviCRM and a complex group structure - will it work?
July 24, 2010, 03:36:06 am
Hmmm, I did see an article about when each hook is called, but can't seem to find it now.

The wierd thing is that I can dump the variable and see it changed, but it makes no difference when it creates the membership...

I am trying with a pre hook, to see if I can get any love there. So far the same - the variable changes, but the start date remains the same...

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviCRM and a complex group structure - will it work?
July 24, 2010, 04:22:08 pm
The 'post' hook is called after a DB insert. So trapping insert of membership record and then modifying it might be the way to go (not tried it - but if the hook fires when the new membership record is inserted - you should be able to use the api to modify it).
Protect your investment in CiviCRM by  becoming a Member!

Pages: 1 2 3 [4]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Pre-installation Questions (Moderator: Dave Greenberg) »
  • CiviCRM and a complex group structure - will it work?

This forum was archived on 2017-11-26.