Jump to content


Photo

CiviCrm + Pagelines = No Cron

CiviCrm

  • Please log in to reply
14 replies to this topic

#1 jkfromk

jkfromk

    Member

  • Members
  • PipPip
  • 10 posts
  • Country: Country Flag

Posted 05 March 2013 - 08:01 PM

I am testing a CiviCrm with PageLines (lite) before I purchase the pro. When trying to access the Cron.php (accessed by:  utility to run scheduled jobs I am getting the following PHP error: 

 

Fatal error: Call to a member function pagelines_register_sections() on a non-object in 

 

It is referencing the following file / line number: /wp-content/themes/pagelines/includes/class.sections.php on line 79

 

CiviCrm Module: <siteroot>/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=userk&pass=pass&key=key)

 

I don't get this error using other themes however really like the Pagelines theme and want to purchase if I can get it working together with CiviCrm.

 

Any ideas? 

 

 



#2 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 05 March 2013 - 10:04 PM

I've never used civicrm, but that pagelines error message would make me think the pagelines sections plugin isn't activated. You should see a message/prompt to activate this in Pagelines>store



#3 jkfromk

jkfromk

    Member

  • Members
  • PipPip
  • 10 posts
  • Country: Country Flag

Posted 05 March 2013 - 10:20 PM

I was thinking along the same lines however have confirmed that "Sections" is installed and activated. I am wondering if it has to do w/ accessing via the Plugin path:    <siteroot>/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=userk&pass=pass&key=key)  and Pagelines doesn't know how to handle?



#4 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 06 March 2013 - 02:49 AM

I'm not sure to be honest, I'll ask one of our developers to see if he can advise on the above for you.



#5 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 06 March 2013 - 06:34 AM

I'd also suggest checking with civicrm and seeing if they have any ideas on the error message, they'd probably have seen it before on other platforms and might be able to advise too :-)



#6 jkfromk

jkfromk

    Member

  • Members
  • PipPip
  • 10 posts
  • Country: Country Flag

Posted 06 March 2013 - 01:55 PM

Thanks for the replies. I have an inquiry in w/ CiviCrm as well.  



#7 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 06 March 2013 - 05:18 PM

Ok, please keep us updated.



#8 jkfromk

jkfromk

    Member

  • Members
  • PipPip
  • 10 posts
  • Country: Country Flag

Posted 07 March 2013 - 08:42 PM

No luck on the CiviCrm site at all. In looking at class.sections.php ln 79 I see:

 

 

function set_section_info(){
 
global $load_sections;
Ln 79 $available = $load_sections->pagelines_register_sections( false, true );
 
$type = $this->section_install_type( $available );
 
global $load_sections;
Ln 84 $available = $load_sections->pagelines_register_sections( false, true );
$this->sinfo = $available[$type][$this->class_name];
 
If I comment ln 79 it throws same error on ln 84. Then commenting 84 the error goes away but I wonder what the issue is as I can't tell what is broken in the test site. 
 
Any ideas as to the cause or possible work-around? 


#9 jkfromk

jkfromk

    Member

  • Members
  • PipPip
  • 10 posts
  • Country: Country Flag

Posted 07 March 2013 - 08:50 PM

seems if these lines are commented the slider and twitter feed sections don't work the same. 



#10 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 07 March 2013 - 09:17 PM

You shouldn't be editing the framework.

 

That plugin, if you can call it that, is loading a minimal wordpress to allow you to authenticate, then it runs the cron script. Trouble is, it does not need the whole of wordpress, and all its plugin and the loaded theme JUST to authenticate the user for a cronjob!!

So basically, the authors are just doing it wrong, well, they couldn't find a better way to do it ;)

 

Here is a working 'fix'

 

 

Plus you have to add this to cron.php

 

define( 'CRMCRON', true );



#11 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 07 March 2013 - 09:18 PM

This 'hack' is not supported in any way shape or form.



#12 jkfromk

jkfromk

    Member

  • Members
  • PipPip
  • 10 posts
  • Country: Country Flag

Posted 07 March 2013 - 09:44 PM

Thanks for the hack, I sincerely appreciate it.  To be sure, can you confirm the file referenced here: // Add this to wp-content/mu-plugins/crm.php

 

 

Do I create that file or add? I ask because I don't see that file currently. 



#13 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 07 March 2013 - 09:45 PM

create it.



#14 jkfromk

jkfromk

    Member

  • Members
  • PipPip
  • 10 posts
  • Country: Country Flag

Posted 08 March 2013 - 03:02 PM

I believe I have done as instructed but am now getting error in crm.php across the entire site.  To prevent site-wide issue I took out crm.php out of mu-plugins and added: require_once '/path/to/crm.php'; to the cron.php file.  The error now is: 

 

Fatal error: Class 'Fix_CRM_Cron' not found on line 20 (crm.php)

 

 

This same error occurs if I access the crm.php directly. 



#15 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 09 March 2013 - 03:05 PM

The code does work; I tested it myself. Feel free to post the code to the CRM support site, they might be able to help you.







Also tagged with one or more of these keywords: CiviCrm