Thread: SitemapXML v.2

Page 217 of 222 FirstFirst ... 117167207215216217218219 ... LastLast
Results 2,161 to 2,170 of 2213
  1. #2161
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,354
    Plugin Contributions
    94

    Default Re: SitemapXML v.2

    Edit /includes/modules/pages/sitemapxml/sitemapxml_manufacturers.php, line 41 ... adding the highlighted bit
    Code:
            $sitemapXML->writeItem(FILENAME_DEFAULT, 'manufacturers_id=' . $next_manufacturer['manufacturers_id'], $next_manufacturer['languages_id'], $next_manufacturer['last_date'] ?? $last_date, SITEMAPXML_MANUFACTURERS_CHANGEFREQ, $xtra);
    Thanks for the report!

  2. #2162
    Join Date
    Jan 2015
    Posts
    493
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    that worked :)

  3. #2163
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,354
    Plugin Contributions
    94

    Default Re: SitemapXML v.2

    v4.0.3 is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=367

    This release contains changes associated with GitHub issue #49 (Product-reviews/reviews/manufacturers) sitemaps throw deprecation log if a last-updated date is null).

  4. #2164
    Join Date
    Apr 2011
    Posts
    507
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Quote Originally Posted by lat9 View Post
    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);
    Noted. Thank you

  5. #2165
    Join Date
    Oct 2007
    Posts
    379
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    There seems to be an issue with v3.9.9 of this plugin, when creating EZ pages.
    The plugin page states that v3.9.9 is the last version supporting zen cart v1.5.7. Does this mean that v4.0.3 does not work with zen cart v1.5.7b, or does it mean that v1.5.7 just isn't supported anymore. What I'm trying to find out is if it would work if I install v4.0.3 in zencart 1.5.7.

  6. #2166
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,354
    Plugin Contributions
    94

    Default Re: SitemapXML v.2

    Quote Originally Posted by DML73 View Post
    There seems to be an issue with v3.9.9 of this plugin, when creating EZ pages.
    The plugin page states that v3.9.9 is the last version supporting zen cart v1.5.7. Does this mean that v4.0.3 does not work with zen cart v1.5.7b, or does it mean that v1.5.7 just isn't supported anymore. What I'm trying to find out is if it would work if I install v4.0.3 in zencart 1.5.7.
    Since the readme for v4.0.0 and later indicate that support's dropped for Zen Cart versions prior to 1.5.8, I'm guessing that SitemapXML will be throwing PHP errors/warnings if you try to use it with 1.5.7.

    For the plugins that I support, like this one, I tend to keep support for the most recent 2 or 3 Zen Cart versions. I just don't have the time to test (and support) their usage on the older Zen Cart versions.

  7. #2167
    Join Date
    Oct 2007
    Posts
    379
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Thanks, that makes sense.

  8. #2168
    Join Date
    Jun 2012
    Location
    California
    Posts
    238
    Plugin Contributions
    0

    Default Re: SitemapXML v.2

    Hi Lat9. yes its me again

    ZC2.1
    PHP 8.3
    authorizenet_merchant_seal_2.0
    customer_tax_exempt_2.0.2
    edit_orders-5.0.0
    sitemapxml-master-4.0.3
    usps-USPS_2024_08_25_K11l
    zen_TyPackageTracker-5.0.0

    I installed the latest github release of sitemapxml yesterday and got this debug log overnight:

    Code:
    [22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
    #0 [internal function]: zen_debug_error_handler()
    #1 //public_html/includes/init_includes/init_sessions.php(36): dirname()
    #2 //public_html/includes/autoload_func.php(40): require_once('/...')
    #3 //public_html/includes/application_top.php(329): require('/...')
    #4 //public_html/index.php(25): require('/...')
    #5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
    --> PHP Deprecated: dirname(): Passing null to parameter #1 ($path) of type string is deprecated in //public_html/includes/init_includes/init_sessions.php on line 36.
    
    [22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
    #0 [internal function]: zen_debug_error_handler()
    #1 //public_html/includes/classes/navigation_history.php(38): preg_match()
    #2 //public_html/includes/autoload_func.php(62): navigationHistory->add_current_page()
    #3 //public_html/includes/application_top.php(329): require('/...')
    #4 //public_html/index.php(25): require('/...')
    #5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
    --> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/classes/navigation_history.php on line 38.
    
    [22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
    #0 [internal function]: zen_debug_error_handler()
    #1 //public_html/includes/init_includes/init_customer_auth.php(83): preg_match()
    #2 //public_html/includes/autoload_func.php(40): require_once('/...')
    #3 //public_html/includes/application_top.php(329): require('/...')
    #4 //public_html/index.php(25): require('/...')
    #5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
    --> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/init_includes/init_customer_auth.php on line 83.
    
    [22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
    #0 [internal function]: zen_debug_error_handler()
    #1 //public_html/includes/init_includes/init_customer_auth.php(84): preg_match()
    #2 //public_html/includes/autoload_func.php(40): require_once('/...')
    #3 //public_html/includes/application_top.php(329): require('/...')
    #4 //public_html/index.php(25): require('/...')
    #5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
    --> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/init_includes/init_customer_auth.php on line 84.
    
    [22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
    #0 [internal function]: zen_debug_error_handler()
    #1 //public_html/includes/init_includes/init_customer_auth.php(139): preg_match()
    #2 //public_html/includes/autoload_func.php(40): require_once('/...')
    #3 //public_html/includes/application_top.php(329): require('/...')
    #4 //public_html/index.php(25): require('/...')
    #5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
    --> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/init_includes/init_customer_auth.php on line 139.
    
    [22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
    #0 [internal function]: zen_debug_error_handler()
    #1 //public_html/includes/init_includes/init_customer_auth.php(140): preg_match()
    #2 //public_html/includes/autoload_func.php(40): require_once('/...')
    #3 //public_html/includes/application_top.php(329): require('/...')
    #4 //public_html/index.php(25): require('/...')
    #5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
    --> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/init_includes/init_customer_auth.php on line 140.
    
    [22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
    #0 [internal function]: zen_debug_error_handler()
    #1 //public_html/includes/functions/whos_online.php(13): preg_match()
    #2 //public_html/includes/init_includes/init_special_funcs.php(18): zen_update_whos_online()
    #3 //public_html/includes/autoload_func.php(40): require_once('/...')
    #4 //public_html/includes/application_top.php(329): require('/...')
    #5 //public_html/index.php(25): require('/...')
    #6 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
    --> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/functions/whos_online.php on line 13.
    1) Usually I see my true ip address on the first line of each paragraph:
    "[22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1"
    Does this indicate that I have something setup wrong and that is what is causing this issue?
    OR
    2) While it appears that sitemapxml is involved in each of these issues it appears that the issue is within files outside of sitemapxml.
    It appears to be an issue with coding in each of the files pertaining to the passing of null to a parameter.
    Can I just implement the following solution, courtesy of www.php.cn, to each incident to correct this issue:

    "The null coalescing operator (??) can be employed to provide a default value when null is encountered. For example, htmlspecialchars($something) can be modified to htmlspecialchars($something ?? ''). This ensures that an empty string is returned when null is passed."

    For example:

    Code:
    $path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
    Could I just change this to the following in each incident?

    Code:
    $path = str_replace('\\', '/', dirname($_SERVER ?? ''['SCRIPT_NAME']));

  9. #2169
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,843
    Plugin Contributions
    11

    Default Re: SitemapXML v.2

    Quote Originally Posted by wsworx View Post
    ...

    For example:

    Code:
    $path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
    Could I just change this to the following in each incident?

    Code:
    $path = str_replace('\\', '/', dirname($_SERVER ?? ''['SCRIPT_NAME']));
    you can do whatever you want. BUT, your code change will NOT address your issue, and you are mis-understanding the $_SERVER['SCRIPT_NAME'] var and potentially the use of the null coalescing operator.

    i would look to understand why $_SERVER['SCRIPT_NAME'] is not getting set.

    overriding core code, especially in the init_includes directory, is never a good idea.

    best.
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  10. #2170
    Join Date
    Feb 2009
    Posts
    98
    Plugin Contributions
    1

    Default Re: SitemapXML v.2

    Quote Originally Posted by wsworx View Post
    Hi Lat9. yes its me again
    Excuse me for sticking my oar in, I'm not even in my work environment so can't really investigate, but I note the timestamp of your logs is 6 seconds after 5am, which leads me to guess it's a cron job that's running the sitemapxml script at 5am, so your $_SERVER variables may be impacted by the environment the script was run in, differently to the usual browser invocation. I agree with @cartwhat, editing core files is unlikely to be a good idea, unless you've uncovered a genuine bug. From a cursory read of the documentation at https://www.php.net/manual/en/reserv...les.server.php I can't see why SCRIPT_NAME would be null. Can you give us any details of the exact command line that invoked PHP to run the cgi-bin/sitemapxml.php script? Is there something funky going on with the environment? (try `crontab -l | grep sitemap` to see if any cron commands invoke sitemapxml, your environment may vary)

    Personally, I might experiment with logging variables to a file to figure out why your variables are null, though Zen Cart has never had a decent logging framework that I've seen. I built Monolog into mine, with file and Graylog handlers.

    By the way, you suggested replacing `dirname($_SERVER['SCRIPT_NAME'])` with `dirname($_SERVER ?? ''['SCRIPT_NAME'])`, which would imply that `$_SERVER` may undefined, which is unlikely. I'd suggest `dirname($_SERVER['SCRIPT_NAME'] ?? '')` at the very least, as a more sensible use of the null coalescing operator ??, but still a bad idea as @cartwhat said, find the root cause of the error rather than modifying core files.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR