View Issue Details

IDProjectCategoryView StatusLast Update
0004572OXID eShop (all versions)2.8. Servicepublic2013-02-07 11:55
Reporterastehlik Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.6.4 revision 49061 
Target Version4.6.6 revision 54646Fixed in Version4.6.7 
Summary0004572: Date errors in monthly visitor and conversion rate reports
DescriptionWhen generating reports the monthly graph for absolute visitors and the conversion rate start in the year 1970 and do not contain any data.

The reason for that is, that in the used queries non-defined variables are used:

admin/reports/report_conversion_rate.php
admin/reports/report_visitor_absolute.php

I attach a patch that fixes theses bugs.
TagsReports
Attached Files
oxid_report_fix.txt (2,996 bytes)   
diff --git admin/reports/report_canceled_orders.php admin/reports/report_canceled_orders.php
index 432645e..a58dd22 100644
--- admin/reports/report_canceled_orders.php
+++ admin/reports/report_canceled_orders.php
@@ -270,7 +270,7 @@ class Report_canceled_orders extends report_base
         $rs = oxDb::getDb()->execute( $sQ );
         if ( $rs != false && $rs->recordCount() > 0 ) {
             while ( !$rs->EOF ) {
-                $sKey = oxUtilsDate::getInstance()->getWeekNumber( $myConfig->getConfigParam( 'iFirstWeekDay' ), strtotime( $rs->fields[0] ) );
+                $sKey = oxUtilsDate::getInstance()->getWeekNumber( oxConfig::getConfigParam( 'iFirstWeekDay' ), strtotime( $rs->fields[0] ) );
                 if ( isset( $aDataX5[$sKey] ) ) {
                     $aDataX5[$sKey]++;
                 }
diff --git admin/reports/report_conversion_rate.php admin/reports/report_conversion_rate.php
index 1eba570..8f7cd63 100644
--- admin/reports/report_conversion_rate.php
+++ admin/reports/report_conversion_rate.php
@@ -73,8 +73,11 @@ class Report_conversion_rate extends report_base
         $aDataX = array();
         $aDataY = array();
 
-        $sTimeTo    = $oDb->quote( date( "Y-m-d H:i:s", strtotime( oxConfig::getParameter( "time_to" ) ) ) );
-        $sTimeFrom = $oDb->quote( date( "Y-m-d H:i:s", mktime( 23, 59, 59, date( "m", $dTimeTo)-12, date( "d", $dTimeTo), date( "Y", $dTimeTo)) ) );
+        $dTimeTo = strtotime( oxConfig::getParameter( "time_to" ) );
+        $dTimeFrom = mktime( 23, 59, 59, date( "m", $dTimeTo)-12, date( "d", $dTimeTo), date( "Y", $dTimeTo));
+
+        $sTimeTo    = $oDb->quote( date( "Y-m-d H:i:s", $dTimeTo) );
+        $sTimeFrom = $oDb->quote( date( "Y-m-d H:i:s", $dTimeFrom ) );;
 
         // orders
         $sSQL = "select oxtime, count(*) as nrof from oxlogs where oxtime >= $sTimeFrom and oxtime <= $sTimeTo group by oxsessid";
diff --git admin/reports/report_visitor_absolute.php admin/reports/report_visitor_absolute.php
index 29c8898..fa22185 100644
--- admin/reports/report_visitor_absolute.php
+++ admin/reports/report_visitor_absolute.php
@@ -77,8 +77,11 @@ class Report_visitor_absolute extends report_base
         $aDataX = array();
         $aDataY = array();
 
-        $sTimeTo   = $oDb->quote( date( "Y-m-d H:i:s", strtotime( oxConfig::getParameter( "time_to" ) ) ) );
-        $sTimeFrom = $oDb->quote( date( "Y-m-d H:i:s", mktime( 23, 59, 59, date( "m", $dTimeTo ) - 12, date( "d", $dTimeTo ), date( "Y", $dTimeTo ) ) ) );
+        $dTimeTo = strtotime( oxConfig::getParameter( "time_to" ) );
+        $dTimeFrom = mktime( 23, 59, 59, date( "m", $dTimeTo)-12, date( "d", $dTimeTo), date( "Y", $dTimeTo));
+
+        $sTimeTo   = $oDb->quote( date( "Y-m-d H:i:s", $dTimeTo ) );
+        $sTimeFrom = $oDb->quote( date( "Y-m-d H:i:s", $dTimeFrom ) );
 
         $sSQL = "select oxtime, count(*) as nrof from oxlogs where oxtime >= $sTimeFrom and oxtime <= $sTimeTo group by oxsessid";
         $aTemp = array();
oxid_report_fix.txt (2,996 bytes)   
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Activities

astehlik

2012-10-01 17:22

reporter   ~0007520

Today I received 2 mails that told me this issue was deleted. But it's still here. Very strange...

aurimas.gladutis

2013-02-07 11:55

reporter   ~0008386

fixed reports generation.