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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.4 Release Testing »
  • CiviDiscount not serializing - throwing assorted errors
Pages: [1]

Author Topic: CiviDiscount not serializing - throwing assorted errors  (Read 2867 times)

dtheweather9

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
    • Students for the Exploration and Development of Space, USA
  • CiviCRM version: 4.4.0
  • CMS version: WordPress 3.8.1
  • MySQL version: 5.1.56
  • PHP version: 5.4.11
CiviDiscount not serializing - throwing assorted errors
September 16, 2013, 04:53:22 pm
Greetings,ke i
I have a Wordpress 4.4 Beta CiviDiscount 2.1 running at the moment; It looks like in stead of storing the price sets as a serialized list, its storing it as an integer.

The code should be 64, 93, and 92, instead priceset is being stored as "649392".

It appears this is corrupting a few other things, as I get the following error:

Quote
Fatal error: Class 'CDM_BAO_Item' not found in /home/sedstest/test.seds.org/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form.php on line 71

Has this error been previously seen?

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: CiviDiscount not serializing - throwing assorted errors
September 16, 2013, 05:44:23 pm

Most likely you are not seeing the CTRL-A (\001) separator that splits the priceset ids

the other error is not related and is most likely due to the include path not being set properly. Can you add some debug statements to the config hook in the extension and see if you can figure out whats happening and why

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

dtheweather9

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
    • Students for the Exploration and Development of Space, USA
  • CiviCRM version: 4.4.0
  • CMS version: WordPress 3.8.1
  • MySQL version: 5.1.56
  • PHP version: 5.4.11
Re: CiviDiscount not serializing - throwing assorted errors
September 16, 2013, 09:26:16 pm
It appears you're correct on the separator; the pricesets have the hidden character correctly set.

Initially looked like the 'Extension Resource URL' was incorrect (was "/wp-content/plugins/files/civicrm/" and needed to be "/wp-content/plugins/files/civicrm/modules/".  I modified the url to the correct folder, however after clearing the caches (both wordpress cache and civicrm), the issue is still cropping up. 

I'm going to start trying to dig into the extension and see if I can add debug statements.

dtheweather9

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
    • Students for the Exploration and Development of Space, USA
  • CiviCRM version: 4.4.0
  • CMS version: WordPress 3.8.1
  • MySQL version: 5.1.56
  • PHP version: 5.4.11
Re: CiviDiscount not serializing - throwing assorted errors
September 18, 2013, 06:39:42 am
lobo,
I haven't had too much experience in playing with the hooks on extensions; can you point me to where the config hook is located?

Additionally looking at some civicrm forms on the public pages, the discount code field is not showing up either.

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: CiviDiscount not serializing - throwing assorted errors
September 18, 2013, 06:59:11 am

Might help to skim thru the developer book at http://book.civicrm.org/

in this specific case, it should be here:

org.civicrm.module.cividiscount/cividiscount.php

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

dtheweather9

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
    • Students for the Exploration and Development of Space, USA
  • CiviCRM version: 4.4.0
  • CMS version: WordPress 3.8.1
  • MySQL version: 5.1.56
  • PHP version: 5.4.11
Re: CiviDiscount not serializing - throwing assorted errors
September 18, 2013, 12:53:46 pm
Threw the following into the buttom of the config function:
Code: [Select]
  //Diagnostics
  $DMPmail = "cividiscountRoot = " . $cividiscountRoot . "<br>";
  $DMPmail .= "cividiscountDir = " . $cividiscountDir . "<br>";
  $DMPmail .= "template->template_dir = " . $template->template_dir . "<br>";
  $DMPmail .= "include_path = " . $include_path . "<br>"; 
 
  mail("[myemail]","CiviDiscount diagnostics", $DMPmail);
and that yielded the following:
Code: [Select]
cividiscountRoot = [SITEROOT]/wp-content/plugins/files/civicrm/modules/org.civicrm.module.cividiscount-2.1/
cividiscountDir = [SITEROOT]/wp-content/plugins/files/civicrm/modules/org.civicrm.module.cividiscount-2.1/templates
template->template_dir = Array
include_path = [SITEROOT]/wp-content/plugins/files/civicrm/modules/org.civicrm.module.cividiscount-2.1/:[SITEROOT]/wp-content/plugins/files/civicrm/customphp/:.:[SITEROOT]/wp-content/plugins/civicrm/civicrm/:[SITEROOT]/wp-content/plugins/civicrm/civicrm//packages:.:/usr/local/lib/php:/usr/local/php5/lib/pear

is the templates directory generally a string?

[SITEROOT]/wp-content/plugins/files/civicrm/modules/org.civicrm.module.cividiscount-2.1/cividiscount.php is the location of the cividiscount.php file.
« Last Edit: September 18, 2013, 12:55:40 pm by dtheweather9 »

dtheweather9

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
    • Students for the Exploration and Development of Space, USA
  • CiviCRM version: 4.4.0
  • CMS version: WordPress 3.8.1
  • MySQL version: 5.1.56
  • PHP version: 5.4.11
Re: CiviDiscount not serializing - throwing assorted errors
September 19, 2013, 10:25:20 pm
I've compared paths between two development civicrm versions, one on my version 4.3 and the other 4.4; there is no significant difference in the include_path variable; yet 4.3 is functioning and 4.4.beta is not. 

If it isn't the path what else would likely be the case?

dtheweather9

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
    • Students for the Exploration and Development of Space, USA
  • CiviCRM version: 4.4.0
  • CMS version: WordPress 3.8.1
  • MySQL version: 5.1.56
  • PHP version: 5.4.11
Re: CiviDiscount 4.4 Wordpress Form.php Error
September 23, 2013, 08:01:18 am
Is it possible to load CiviDiscount onto the sandbox?  I'm unable to tell if its my install or server issue or if its a an issue with the new civicrm version (aside from Cividiscount working in my 4.3 and not in 4.4 install)

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: CiviDiscount not serializing - throwing assorted errors
September 23, 2013, 12:37:19 pm
can u install it via the UI?

In general we prefer not too have any extensions loaded directly in the demo (for now). Managing and maintaining the demo sites is a fair bit of time and resources

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

dtheweather9

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
    • Students for the Exploration and Development of Space, USA
  • CiviCRM version: 4.4.0
  • CMS version: WordPress 3.8.1
  • MySQL version: 5.1.56
  • PHP version: 5.4.11
Re: CiviDiscount not serializing - throwing assorted errors
September 23, 2013, 01:03:31 pm
CiviDiscount isn't one of the downloadable extensions via the UI at the moment; I've had to download it manually (and thus can't download it on the demo site, even after setting the extensions url/directory) - I tried with drupal and wordpress to the same result.

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: CiviDiscount not serializing - throwing assorted errors
September 24, 2013, 03:46:59 pm

I downloaded and installed CiviDiscount via git and tried it in 4.4

Things worked for me. I am using the git repository for both cividiscount and civicrm, but i dont think the code was changed recently in the extensions area

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

dtheweather9

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
    • Students for the Exploration and Development of Space, USA
  • CiviCRM version: 4.4.0
  • CMS version: WordPress 3.8.1
  • MySQL version: 5.1.56
  • PHP version: 5.4.11
Re: CiviDiscount not serializing - throwing assorted errors
September 25, 2013, 12:47:40 pm
Ok, found at least part of the issue.

Looks like in CRM-12743 (https://github.com/civicrm/civicrm-core/commit/0e6e872410535da3f9d4675e1005c27a06fac5ba#diff-bafe6d6cf60782b3aaac27935480cfd1) the "require_once" was removed from form.php.

I was able to re-enable my admin edit mode by adding the following line back in:

Code: [Select]
require_once (str_replace('_', DIRECTORY_SEPARATOR, $this->_BAOName) . ".php");
I assume that retrieve should be taking care of this, but it looks like there may be an issue.

Still experiencing some other issues with it not showing up on public page, so I wonder if the same fix will work for that.

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: CiviDiscount not serializing - throwing assorted errors
September 25, 2013, 02:35:22 pm

1. i also gave this a try with a clean install of civicrm - v4.4 (from git), cividiscount (from git) and wp 3.6.1. Things worked quite nicely :) tried it with a default event and the discount field appeared and did the right thing

2. The require statement is not needed. we are doing auto-classloading for civi core (since v4.2 i think). If that is broken, i suspect something is broken even before that stage which u'll need to track down

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

dtheweather9

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 1
    • Students for the Exploration and Development of Space, USA
  • CiviCRM version: 4.4.0
  • CMS version: WordPress 3.8.1
  • MySQL version: 5.1.56
  • PHP version: 5.4.11
Re: CiviDiscount not serializing - throwing assorted errors
September 25, 2013, 09:42:35 pm
It appears that 4.3 to 4.4 is the first time the require_once has been removed (as part of the eval change);

I'm not 100% sure why your install worked fine and mine are throwing issues; I did another wordpress install, v4.4.B3 (from website), wp 3.6.1, and CDM2.1, on a 3rd server and it failed with the same issue.

Tracking it down to the autoloader, it appears that, from the notes, its only loading things which are "Only load classes that clearly belong to CiviCRM.".  As this particular line seaches for anything that starts with "CRM_", only those classes have their files loaded.

The name of the class CiviDiscount is showing is "CDM_", so its apparent why the cividiscount.php file isn't being thrown.  I'm curious lobo; what is the name thats showing up for your class for cividiscount? 

Just for kicks to help diagnose the issue I threw in an elseif to also add "CDM_" - this solved most of the issues, the only thing apparently remaining is for some reason its not showing the discount code location on the contribution pages at the moment.

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: CiviDiscount not serializing - throwing assorted errors
September 26, 2013, 07:19:58 am

cividiscount does not use autoloading, but civi core does. cividiscount does have the needed requires

at this point, i cant help a lot more. spent a fair bit of time on this already. please update this topic when u've figured it out. I'd be happy to answer a few questions on irc if needed

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.4 Release Testing »
  • CiviDiscount not serializing - throwing assorted errors

This forum was archived on 2017-11-26.