Archived

This topic is now archived and is closed to further replies.

  • 0

CiviCrm + Pagelines = No Cron


Question

Posted · Report post

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? 

 

 

Share this post


Link to post
Share on other sites

14 answers to this question

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

Ok, please keep us updated.

Share this post


Link to post
Share on other sites

Posted · Report post

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. 

Share this post


Link to post
Share on other sites

Posted · Report post

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.

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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?

Share this post


Link to post
Share on other sites

Posted · Report post

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.

Share this post


Link to post
Share on other sites

Posted · Report post

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? 

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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'

 

https://gist.github.com/Pross/5111864

 

Plus you have to add this to cron.php

 

define( 'CRMCRON', true );

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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 :-)

Share this post


Link to post
Share on other sites

Posted · Report post

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. 

Share this post


Link to post
Share on other sites

Posted · Report post

create it.

Share this post


Link to post
Share on other sites