Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1661 closed Bug (fixed)

PDFReports: misc/cron/archive.sh launches an exception

Reported by: scara Owned by:
Priority: major Milestone: Piwik 1.1
Component: Core Keywords:
Cc: Sensitive: no

Description

Find below the exception:

PHP Fatal error:  Call to undefined method Piwik_PDFReports::getReports() in /path/to/piwik-1.0/plugins/PDFReports/API.php on line 307

getReports() belongs to Piwik_PDFReports_API class and, now (far from v0.7, http://dev.piwik.org/trac/changeset?new=2989%40trunk%2Fplugins%2FPDFReports%2FPDFReports.php&old=2767%40trunk%2Fplugins%2FPDFReports%2FPDFReports.php#file0) PDFReports scheduled tasks send emails through a static call within the context of Piwik_PDFReports:

class Piwik_PDFReports extends Piwik_Plugin
{
...
	function generateAndSendScheduledReports($period)
	{
...
		// For each, generate the file and send the message with the attached report
		foreach($reportsToGenerate as $report)
		{
			Piwik_PDFReports_API::sendEmailReport(	$report['idreport'], 
													$report['idsite'], 
													$period);
		}
	}

Change History (5)

comment:1 Changed 4 years ago by scara

Maybe:

--- piwik-1.0/plugins/PDFReports/PDFReports.php        2010-08-31 14:20:28.000000000 +0200
+++ piwik/plugins/PDFReports/PDFReports.php    2010-08-31 14:21:19.000000000 +0200
@@ -68,9 +68,9 @@
                // For each, generate the file and send the message with the attached report
                foreach($reportsToGenerate as $report)
                {
-                       Piwik_PDFReports_API::sendEmailReport(  $report['idreport'],
-                                                                                                       $report['idsite'],
-                                                                                                       $period);
+                       Piwik_PDFReports_API::getInstance()->sendEmailReport(   $report['idreport'],
+                                                                                                                                $report['idsite'],
+                                                                                                                                $period);
                }
        }

?

comment:2 Changed 4 years ago by vipsoft (robocoder)

  • Keywords PDFReports removed
  • Milestone set to 1.1 - Piwik 1.1

comment:3 Changed 4 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [3038]) fixes #1661 - $this not set correctly; thanks scara

comment:4 Changed 4 years ago by vipsoft (robocoder)

  • Summary changed from [1.0][PDFReports] misc/cron/archive.sh launches an exception to PDFReports: misc/cron/archive.sh launches an exception

comment:5 Changed 4 years ago by vipsoft (robocoder)

(In [3042]) refs #1661 - propset svn:executable on archive.sh

Note: See TracTickets for help on using tickets.