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 (Moderator: Donald Lobo) »
  • Problem with membership when pay later is chosen
Pages: [1]

Author Topic: Problem with membership when pay later is chosen  (Read 894 times)

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Problem with membership when pay later is chosen
July 15, 2009, 11:16:34 am
I have been working on a system to handle chapters for one of my clients. I have most of it working and members are able to join chapters on the same page where they sign up for membership to the parent org.

The problem I have is if it is a pay later set up, I want to set the join date to null, which is just what CiviCRM does when adding a membership. When I use the Membership API call
Code: [Select]
civicrm_contact_membership_create($mem_params); with join_date set to null or 0, the record never gets added to the db. If I use today's date as the join date, the record gets added correctly. Is this a bug in CiviCRM, or is this the correct behavior?

Thanks for your help,
Quint
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Problem with membership when pay later is chosen
July 15, 2009, 12:06:33 pm
try setting it to: 0000-00-00 00:00
(just a guess -- I think the field definition disallows null values)
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Problem with membership when pay later is chosen
July 15, 2009, 02:24:35 pm
The field def in MySQL has the default value set as null.

If I leave the join_date value out of the params array in the api call or set it to null, the record never gets added. I looked at the API code and it isn't immediately evident why this would be a problem.

I am going to keep digging and I'll post back if I figure it out.
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Problem with membership when pay later is chosen
July 15, 2009, 02:36:03 pm
OK - I looked at the API code and followed that into the BAO code and found that to have the pay later handled correctly, you must set is_override to 1.
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Problem with membership when pay later is chosen

This forum was archived on 2017-11-26.