email - Cron PHP Code Fails to Run on Magento and Produces Error -
so inherited product reviews module. cron runs every 6 hours. checks when send email out, has not been working of late.
here's config.xml file part containing crontab. crontab node placed within .
<crontab> <jobs> <company_reviews_delay> <schedule> <cron_expr>* * * * *</cron_expr><!-- every 6 hours --> </schedule> <run> <model>reviews/adminhtml_observer::delaysend</model> </run> </company_reviews_delay> </jobs> </crontab>
the php file delaysend method in reviews/model/adminhtml/observer.php here's code it
public function delaysend() { $error_counter = 0; $unsent_notifications = $this->getnotificationcollection()->addfieldtofilter('notified', array('lt' => 1)); foreach($unsent_notifications $notification){ try{ $order = mage::getmodel('sales/order')->loadbyincrementid($notification->getorderid()); if(!$this->getconfig()->iscronenabled($order->getstoreid()) || !$this->getconfig()->isenabled($order->getstoreid())){ continue; //skip store disabled } $shipments_collection = $order->getshipmentscollection(); if (empty($shipments_collection)) continue; $shipment = $shipments_collection->getfirstitem(); }catch(exception $e){ if($error_counter == 0){ mage::helper('mymodule_base')->logerror('review delay send error: ' . $e, true); } mage::helper('mymodule_base')->logerror('issue notification order id: ' . $notification->getorderid(), false); $error_counter++; continue; } $execution_time = strtotime($shipment->getcreatedat().'+'. $this->getconfig()->getcrondelay($order->getstoreid())); //e.g (+1 day shipping date) if($execution_time < time()){ $notification->sendemail($order->getstoreid()); } } return $this; }
i substituted simple print "hello"; command in method , ran on command line. hello printed out error:
2015-07-22t15:48:54+00:00 err (3): warning: include(symfony\component\console\event\consoleterminateevent.php): failed open stream: no such file or directory in /home/os2/public_html/lib/varien/autoload.php on line 94 2015-07-22t15:48:54+00:00 err (3): warning: include(symfony\component\console\event\consoleterminateevent.php): failed open stream: no such file or directory in /home/os2/public_html/lib/varien/autoload.php on line 94 2015-07-22t15:48:54+00:00 err (3): warning: include(): failed opening 'symfony\component\console\event\consoleterminateevent.php' inclusion (include_path='/home/os2/public_html/app/code/local:/home/os2/public_html/app/code/community:/home/os2/public_html/app/code/core:/home/os2/public_html/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/os2/public_html/lib/varien/autoload.php on line 94
can offer advice or help? thanks.
Comments
Post a Comment