Jump to content
go9media

PageLines Blocking Cron Job?

Recommended Posts

go9media

Hi everyone. I hope someone will be able to help me with this situation; I'm happy to provide any clarification or additional information needed!

 

I'm using CiviCRM with my PageLines/WP install and have been having issues sending group emails (that's not what I'm asking for help with here, just laying the groundwork a bit to give context). The key to getting the plugin to send the emails seems to be having the cron job on my server fire correctly. I've set up a cron job using wget which should work but doesn't. The test for this is to try the URL I'm using for the wget directly in my browser, but when I do, I get the following error message: 

 

Fatal error: Call to a member function pagelines_register_sections() on a non-object in /home/go9anpf/public_html/wp-content/themes/pagelines/includes/class.sections.php on line 79

 

Searching the PageLines forums for a fix, I found this post:

 

http://www.pagelines.com/forum/topic/25739-civicrm-pagelines-no-cron/ 

 

Trying the crm.php code Simon so helpfully listed in the above post did not change anything for me. To be clear, I'm on the following:

 

PageLines 4.2.1 (Base Theme)

CiviCRM version: 4.2.6

CMS version: WordPress 3.5.1

MySQL version: 5.1.68-cll

PHP version: 5.2.17

 

The more I try to work through this, the deeper it seems to go. Any help or advice (geared toward an advanced-novice level front-end developer) would be much appreciated!

Share this post


Link to post
Share on other sites
Simon

Where did you put the code?

Share this post


Link to post
Share on other sites
go9media

I created a file called crm.php and put the exact code as listed in your post into that file. I then put that file in /wp-content/plugins/

Share this post


Link to post
Share on other sites
Simon

In that case it's in the wrong folder mu-plugins NOT plugins Sent from my iPad using Tapatalk HD

Share this post


Link to post
Share on other sites
go9media

I have no mu-plugins folder in wp-content; should I create one?

Share this post


Link to post
Share on other sites
Simon
I have no mu-plugins folder in wp-content; should I create one?
Yes Sent from my iPad using Tapatalk HD

Share this post


Link to post
Share on other sites
go9media

Okay. Just did that and got this error, sitewide:

 

Fatal error: Class 'Fix_CRM_Cron' not found in /home/go9anpf/public_html/wp-content/mu-plugins/crm.php on line 20

Share this post


Link to post
Share on other sites
James B

Did you add

 

define( 'CRMCRON', true );

 

to the cron.php as well?


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
go9media

Hi James. This is exactly what is in crm.php (copied from the Simon's code in the post linked above):

<?php
// Add this to wp-content/mu-plugins/crm.php

if( class_exists( 'CRM_Utils_System_WordPress' ) ) {
  class Fix_CRM_Cron extends CRM_Utils_System_WordPress {
		
		function __construct() {
			if( ! defined( 'CRMCRON' ) )
				return;
			add_filter('template', array( &$this, 'change_theme') );
			add_filter('option_template', array( &$this, 'change_theme') );
			add_filter('option_stylesheet', array( &$this, 'change_theme') );
		}
		function change_theme() {
		    // Alternate theme
		    return 'twentyten';
		}	
	}
}
new Fix_CRM_Cron;

As you can see, define( 'CRMCRON', true ); is not part of the code.

 

Where would I add that line?

 

Thanks!

Edited by go9media (see edit history)

Share this post


Link to post
Share on other sites
go9media

Gotcha. No, I had not added that. I just did and got the following sitewide error:

 

Fatal error: Class 'Fix_CRM_Cron' not found in /home/go9anpf/public_html/wp-content/mu-plugins/crm.php on line 20

Share this post


Link to post
Share on other sites
Rob

Hi,

 

Are you using this plugin? http://civicrm.org/blogs/jag/wordpress-civimember-role-sync-plugin

 

Also, I've dealt with CiviCRM before with WP.  There are several issues with it that crop up from time to time.

 

From my experience, often when errors are thrown by the system, they point to PageLines Framework, but in fact, the errors have nothing to do with the Framework itself. It's just that it happens within the view of the Framework, so the error is displayed that way.

 

From the looks of that error, my guess is that the cronjob should in this case, be outside the WP structure, since it's calling upon the server's mail function, not a WP function.  To support this, read this Drupal related article:  http://altinukshini.wordpress.com/2011/08/01/civicrm-civimail-cron-job-setup/ as it describes the need to put the cron in the server root.

 

CiviCRM should provide you with support for setting up a cronjob for mail and I believe this topic may point you in the correct direction:  http://book.civicrm.org/user/current/initial-set-up/scheduled-jobs/.

 

This Wiki from their site may also help:  http://wiki.civicrm.org/confluence/display/CRMDOC43/CiviMail+Installation

 

Unfortunately, this cron task is something that should be supported directly by CiviCRM as PageLines isn't going to block any cron task set up properly outside the parameters of WordPress.

 

Hope this helps!


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
go9media

Hi OSE,

 

Thanks for your support on this. I'd gathered from Simon's post that the way CiviCRM has set up the cron.php file that it's needlessly complicated and calling a version of the theme within which to authenticate the login info on the wget process, so I do understand this is really CiviCRM's issue to help me resolve. Unfortunately, though I've posted this issue in their community forums, there's very little in the way of activity and support there for people using CiviCRM on WordPress, so I've not received any real support.

 

Regarding your specific points:

- I'm not using the plugin you reference. There's no connection between my CiviCRM contacts and my WP registered users, so I don't believe I have a need for it. Am I missing something here?

- The Drupal article is interesting. I'm essentially looking for this same kind of solution, but for WordPress. I'm not a coder, so I'm unable to create this myself.

- I am very familiar with the CiviCRM documentation for installation and configuration of CiviMail and for setting up cron job; thanks! Those pieces would be working perfectly if not for the error message created when the wget attempts to authenticate login...

 

I appreciate the PageLines community more and more every day. Many thanks for taking the time to provide all this support.

Share this post


Link to post
Share on other sites
Rob

Do you have Contact7 active on your site? Or any contact form plugins?

 

This was interesting:

http://forum.civicrm.org/index.php?topic=27077.0

 

And it seems to be a common topic on their forum:

http://forum.civicrm.org/index.php?topic=24751.0

 

They have a list of available experts you can call upon that may be able to help you set this up properly:

http://civicrm.org/what/experts

 

I hope this helps!


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
go9media

I did have Contact Form 7 active, but deleted it after reading about it conflicting with cron job. Deleting that plugin has not helped my situation.

 

It is indeed a very common topic; clearly the integration of CiviCRM and WP is less than stellar at this time -- unless your WP install is very basic.

 

Thanks for the link to the expert firms; that will most likely be my next direction I head in.

 

Having someone else to knock these things around with is always a big help! Thanks very much!

Share this post


Link to post
Share on other sites
Rob

You're very welcome.  Let us know how it goes!


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • Bleuy
      By Bleuy+
      How can I get support on pagelines DMS? The product isn't that old and my skeleton themes aren't working and I can't get support in the same way? 
    • Bleuy
      By Bleuy+
      I have a number of legacy websites that are running on the above version of Pagelines DMS, where the template has stopped working. I am using a skeleton theme to all of them. What do I need to do to rectify this.
       
       
    • Anthony King
      By Anthony King+
      It is with much sorrow that I have to say goodbye to a product that had such great potential.
      There has been no acknowledgement from anybody as to whether or not Pagelines will continue
      or even if they are going to hand it over to someone that would keep the project going. I can't
      keep shelling out money every month to a company that either no longer exists or has chosen to 
      abandoned their customer base. Well it has been a nice 5 years.

       
    • ideascurator
      By ideascurator+
      Hello Pagelines,   I no longer use pagelines services. I have deactivated the automatic annual payment. But it already charged to my credit card. Since I cancelled my contract before the end, Can I request to refund?
    • Anthony King
      By Anthony King+
      Hello,
      I am wanting to know what the status of the Pagelines Platform.
      I have noticed that there has been absolutely no updates on Platform 5 for over 8 months.
      Please tell me you haven't gone off on another tangent and going to build the next great solution
      and then leave all of us to have to completely rebuild our sites like we did for
      Pagelines, then DMS, then Pagelines Platform.
      I like what you build, but what you need to do is build one product and then make it better, rather than 
      abandoning it and building something else.
      You haven't done anything for so long that even WordPress is providing a warning.
      "Warning: This plugin has not been tested with your current version of WordPress."
      So what is the Status. I mean if I am going to pay a monthly fee for a product, I don't want to pay for one
      that is no longer being supported. You have a great product, I'm not bashing it, I'm just wondering what 
      your next move is because I have business decisions to make for myself, and whether of not this is something
      I should stick with.

      Please be kind enough to respond.

      Thank You,
      Anthony
×