I had same php warning in logs. Report still worked correctly, just produced the log error. I trid the code change as above and now no error is logged when I generate a report. Thanks for posting.
Printable View
Hi,
When running the report I get the following error:
Zen Cart 1.5.5fQuote:
[10-Jun-2018 07:03:53 UTC] Request URI: /admin/stats_sales_report.php?start_date=01%2F06%2F2017&end_date=10+%2F06%2F2017&date_t arget=purchased&date_status=1&prod_includes=&cust_includes=&payment_method=&paym ent_method_omit=¤t_status=&manufacturer=0&timeframe=year&timeframe_sort=as c&detail_level=order&li_sort_a=oID&li_sort_order_a=asc&li_sort_b=oID&li_sort_ord er_b=asc&output_format=display&new_window=1, IP address: *.*.123.202
#1 mktime() called at [/.../.../admin/includes/classes/sales_report.php:69]
#2 sales_report->__construct() called at [/.../admin/stats_sales_report.php:245]
[10-Jun-2018 07:03:53 UTC] PHP Warning: mktime() expects parameter 4 to be integer, string given in /.../.../admin/includes/classes/sales_report.php on line 69
PHP Version 7.1.18
Could someone point me in the right direction to fix this please?
Why do I get extended information under "Time Frame" i.e:
IST0JanE_Tue0st+05:300AM2019_TueAM2019
Zencart Ver 1.5.6a
Php 7
Thanks
in the file
YOUR_ADMIN\includes\classes\sales_report.php
at the top of the file at approx line 29 define the date format you use eg
define('DATE_FORMAT', 'd/m/Y'); // this is used for date() // addition for PHP 7
Change the comments at the end of the line to your standard for comments
If using PHP 7.3 the following changes will be required. In the file
YOUR_ADMIN\includes\classes\sales_report.php
for compliance with PHP 7.3 change "continue;" to "continue 2;" at approx line 1000,
for compliance with PHP 7.3 change "continue;" to "continue 3;" at approx line 1014
Always perform changes in a test environment and back up before making changes
We have tried everything, however it's a strange server issue, because on our other website with the newer version the Timeframes show properly.
Any server/php int changes suggested for this particular website ?
This is what I get under TimeFrame column:
The date is not shown;
==============
IST0JanE_Tue0st+05:300AM2019_TueAM2019
IST0JanE_Wed0nd+05:300AM2019_WedAM2019
IST0JanE_Thu0rd+05:300AM2019_ThuAM2019
IST0JanE_Fri0th+05:300AM2019_FriAM2019
IST0JanE_Sat0th+05:300AM2019_SatAM2019
IST0JanE_Sun0th+05:300AM2019_SunAM2019
IST0JanE_Mon0th+05:300AM2019_MonAM2019
IST0JanE_Tue0th+05:300AM2019_TueAM2019
IST0JanE_Wed0th+05:300AM2019_WedAM2019
IST0JanE_Thu0th+05:300AM2019_ThuAM2019
IST0JanE_Fri0th+05:300AM2019_FriAM2019
IST0JanE_Sat0th+05:300AM2019_SatAM2019
IST0JanE_Sun0th+05:300AM2019_SunAM2019
IST0JanE_Mon0th+05:300AM2019_MonAM2019
IST0JanE_Tue0th+05:300AM2019_TueAM2019
IST0JanE_Wed0th+05:300AM2019_WedAM2019
IST0JanE_Thu0th+05:300AM2019_ThuAM2019
IST0JanE_Fri0th+05:300AM2019_FriAM2019
IST0JanE_Sat0th+05:300AM2019_SatAM2019
IST0JanE_Sun0th+05:300AM2019_SunAM2019
IST0JanE_Mon0st+05:300AM2019_MonAM2019
IST0JanE_Tue0nd+05:300AM2019_TueAM2019
IST0JanE_Wed0rd+05:300AM2019_WedAM2019
IST0JanE_Thu0th+05:300AM2019_ThuAM2019
IST0JanE_Fri0th+05:300AM2019_FriAM2019
Got below on the logs:
===========
[25-Jan-2019 22:34:59 Asia/Kolkata] PHP Warning: in_array() expects parameter 2 to be array, null given in /home/harry2co/public_html/admin/includes/classes/sales_report.php on line 403
[25-Jan-2019 22:34:59 Asia/Kolkata] Request URI: /adminname/stats_sales_report.php?date_preset=this_month&start_date=&end_date=&date_target= purchased&date_status=1&prod_includes=&cust_includes=&payment_method=&payment_me thod_omit=¤t_status=&manufacturer=0&timeframe=day&timeframe_sort=asc&detai l_level=timeframe&li_sort_order_a=asc&li_sort_order_b=asc&output_format=display, IP address: xxx.yy.26.190
#1 in_array() called at [/home/harry2co/public_html/adminname/includes/classes/sales_report.php:403]
#2 sales_report->build_li_totals() called at [/home/harry2co/public_html/adminname/includes/classes/sales_report.php:259]
#3 sales_report->build_timeframe() called at [/home/harry2co/public_html/adminname/includes/classes/sales_report.php:107]
#4 sales_report->__construct() called at [/home/harry2co/public_html/adminname/stats_sales_report.php:245]
================
Please guide.
Thanks
Please list the Zen cart version and PHP version and version of Sale Report you are using to test this.
Zencart Ver 1.5.6a
Php 7
PHP7.3
Ignore the line about continue 3 in post #735 https://www.zen-cart.com/showthread....73#post1354173. Only the continue 2 is required