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 »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • No radio boxes for selecting a premium in civicontribute
Pages: [1]

Author Topic: No radio boxes for selecting a premium in civicontribute  (Read 3148 times)

dalin

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 8
  • CiviCRM version: many
  • CMS version: Drupal 6
  • MySQL version: 5.0
  • PHP version: 5.2
No radio boxes for selecting a premium in civicontribute
May 24, 2007, 12:24:42 pm
I'm encountering a strange problem.  I have setup civicontribute on my local dev box and created a few working contribution pages.  I then mysqldumped the appropriate tables onto our staging server.  Everything works correctly, except there are no radio buttons to select a premium, and there's no "no thank you" option. 

If I put smarty in debug mode I see that the {$form} array does not contain selectProduct (which on my dev box is an array of the available products). 

Any idea as to why this is not happening?  The code on the two machines is the same.  And as far as I can tell the important data is the same on both machines.  The only difference I can tell is that the staging server runs php4 and my dev box runs php5 (But I'm guessing if that's the issue we would have heard from other people that this isn't working on php4). 

We're running 1.7.9379

I'm going to do a full db dump from staging to local to see if that reveals anything. 
--
Dave Hansen-Lange
Web Developer
Advomatic LLC
http://advomatic.com
Hong Kong office

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: No radio boxes for selecting a premium in civicontribute
May 24, 2007, 03:19:57 pm

If i had to guess, my guess would be this is a php4 problem. A simple test would be to create a new contrib page on the staging server and see if the premium functionality works :)

would be good for u'll to upgrade to a more recent version of php5 on your staging and production servers sometime soon :)

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

dalin

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 8
  • CiviCRM version: many
  • CMS version: Drupal 6
  • MySQL version: 5.0
  • PHP version: 5.2
Re: No radio boxes for selecting a premium in civicontribute
May 24, 2007, 04:04:18 pm
It's got to be a php4 problem.  I just dumped the entire db from the staging server onto my dev box and there is no problem there. 

I've been trying to debug this all afternoon.  It looks to me like the form object is being created ok in
/CRM/Contribute/BAO/Premium.php  CRM_Contribute_BAO_Premium::buildPremiumBlock

I'm not sure where it goes from there, but I'm guessing that's where things get lost. 

Like you suggested I tried creating a new premium item and a new contribution page on the staging server and same problem - can't select a premium item, and "no thank you" doesn't show up.   :P
--
Dave Hansen-Lange
Web Developer
Advomatic LLC
http://advomatic.com
Hong Kong office

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: No radio boxes for selecting a premium in civicontribute
May 24, 2007, 04:29:34 pm

can u please file an issue against 1.7. i suspect its a pretty easy patch and we are forgetting a "pass-by-reference" at some place

thanx

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

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: No radio boxes for selecting a premium in civicontribute
May 24, 2007, 04:32:56 pm

its a trivial fix, thanx for debugging this and giving us the right pointers :)


change line 113 (approx) of BAO/Premium.php to:

    function buildPremiumBlock( &$form , $pageID , $formItems = false ,$selectedProductID = null ,$selectedOption = null ) {

i.e. pass the form object by reference

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

dalin

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 8
  • CiviCRM version: many
  • CMS version: Drupal 6
  • MySQL version: 5.0
  • PHP version: 5.2
Re: No radio boxes for selecting a premium in civicontribute
May 24, 2007, 04:37:22 pm
works like a charm
--
Dave Hansen-Lange
Web Developer
Advomatic LLC
http://advomatic.com
Hong Kong office

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • No radio boxes for selecting a premium in civicontribute

This forum was archived on 2017-11-26.