Sitemap 4.02
ZC 2.0.1
Php 8.3
Not really a big issue but I am getting a depreciated log.
It is a partial log as it is much longer but repeat itself.Code:[22-Nov-2024 16:21:15 America/Los_Angeles] Request URI: /index.php?main_page=sitemapxml&rebuild=yes, IP address: 98.45.172.132, Language id 1 #0 [internal function]: zen_debug_error_handler() #1 /includes/classes/sitemapxml.php(225): strtotime() #2 /includes/modules/pages/sitemapxml/sitemapxml_products_reviews.php(37): zen_SiteMapXML->writeItem() #3 /includes/templates/template_default/sitemapxml/tpl_main_page.php(21): require('/home/zch1akhw6...') #4 /index.php(95): require('/home/zch1akhw6...') --> PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /includes/classes/sitemapxml.php on line 225. [22-Nov-2024 16:21:15 America/Los_Angeles] Request URI: /index.php?main_page=sitemapxml&rebuild=yes, IP address: 98.45.172.132, Language id 1 #0 [internal function]: zen_debug_error_handler() #1 /includes/classes/sitemapxml.php(225): strtotime() #2 /includes/modules/pages/sitemapxml/sitemapxml_products_reviews.php(37): zen_SiteMapXML->writeItem() #3 /includes/templates/template_default/sitemapxml/tpl_main_page.php(21): require('/home/zch1akhw6...') #4 /index.php(95): require('/home/zch1akhw6...') --> PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /includes/classes/sitemapxml.php on line 225.
If there is an easy way to fix it, it would be great
Thank you
Thanks for the report. You can correct that issue by editing /includes/modules/pages/sitemapxml/sitemapxml_prodcts_reviews.php (line 37) adding the highlighted bit below.
Note: GitHub issue opened for tracking ... https://github.com/lat9/sitemapxml/issues/49Code:Note: GitHub issue created for tracking ... https://github.com/lat9/sitemapxml/issues/49 $sitemapXML->SitemapSetMaxItems($reviews->RecordCount()); foreach ($reviews as $next_review) { $sitemapXML->writeItem(FILENAME_PRODUCT_REVIEWS, 'products_id=' . $next_review['products_id'], $next_review['languages_id'], $next_review['last_date'] ?? $last_date, SITEMAPXML_PRODUCTS_REVIEWS_CHANGEFREQ); }
I did the changes as mentioned before but looks like the error is back.
My sitemapxml is on weekly cronjob soit tooks a bit for it to come back.
Here is the log:
Thank you for the assistanceCode:[29-Nov-2024 18:51:29 America/Los_Angeles] Request URI: /index.php?main_page=sitemapxml&rebuild=yes, IP address: 24.4.88.128, Language id 1 #0 [internal function]: zen_debug_error_handler() #1 /includes/classes/sitemapxml.php(225): strtotime() #2 /includes/modules/pages/sitemapxml/sitemapxml_reviews.php(32): zen_SiteMapXML->writeItem() #3 /includes/templates/template_default/sitemapxml/tpl_main_page.php(21): require('/home/zch1akhw6...') #4 /index.php(95): require('/home/zch1akhw6...') --> PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /includes/classes/sitemapxml.php on line 225.
Similar change for /includes/modules/pages/sitemapxml/sitemapxml_reviews.php, line 34, adding the highlighted bits
Code:$sitemapXML->writeItem(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $next_review['products_id'] . '&reviews_id=' . $next_review['reviews_id'], $next_review['language_id'], $next_review['last_date'] ?? $last_date, SITEMAPXML_REVIEWS_CHANGEFREQ);
zencart 2.1.0
php 8.2
Sitemap XML v4.0.2
I am assuming in didnt work because I use different files
When i generator my sitemap i use
- sitemapxml_categories.php
- sitemapxml_categories.php
- sitemapxml_manufacturers.php
- sitemapxml_products.php
This is what I edited. Obviously the reaspon i am getting the error is because I am seing different php files as mentioned above.
includes/modules/pages/sitemapxml/sitemapxml_products_reviews.php
includes/modules/pages/sitemapxml/sitemapxml_reviews.php
[02-Dec-2024 00:41:39 Europe/Berlin] Request URI: /xxx.com/index.php?main_page=sitemapxml&rebuild=yes, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 C:\xampp\htdocs\xxx.com\includes\classes\sitemapxml.php(225): strtotime()
#2 C:\xampp\htdocs\xxx.com\includes\modules\pages\sitemapxml\sitemapxml_manufacture rs.php(41): zen_SiteMapXML->writeItem()
#3 C:\xampp\htdocs\xxx.com\includes\templates\template_default\sitemapxml\tpl_main_ page.php(21): require('C:\\xampp\\htdocs...')
#4 C:\xampp\htdocs\xxx.com\index.php(94): require('C:\\xampp\\htdocs...')
--> PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in C:\xampp\htdocs\xxx.com\includes\classes\sitemapxml.php on line 225.
Last edited by chadlly2003; 2 Dec 2024 at 12:54 AM.
When i generate the sitemap this is what i am sending which is causing the warning just to be clear.
sitemapxml_categories.php
sitemapxml_mainpage.php
sitemapxml_manufacturers.php
sitemapxml_products.php
Bookmarks