Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2015
    Posts
    423
    Plugin Contributions
    0

    Default upgrade question

    Zencart 1.5.8
    php 8.1

    I am trying to do an upgrade from 1.5.7 to 1.58. I noticed that there have been a lot of changes. I also noticed on my log file I am getting a Warning: Undefined variables. Should I be concerned with the warnings and just focus on the errors?

    Just trying to get some advise because I seem to have a lot of log files with warnings. Some examples below




    Code:
    [02-Nov-2022 15:31:17 Europe/Berlin] Request URI: /xxx.com/, IP address: 127.0.0.1
    #0 [internal function]: zen_debug_error_handler()
    #1 C:\xampp\htdocs\xxx.com\includes\extra_datafiles\order_status_filenames.php(11): define()
    #2 C:\xampp\htdocs\xxx.com\includes\init_includes\init_file_db_names.php(78): include('C:\\xampp\\htdocs...')
    #3 C:\xampp\htdocs\xxx.com\includes\application_top.php(198): require('C:\\xampp\\htdocs...')
    #4 C:\xampp\htdocs\xxx.com\index.php(25): require('C:\\xampp\\htdocs...')
    --> PHP Warning: Constant FILENAME_ORDER_STATUS already defined in C:\xampp\htdocs\xxx.com\includes\extra_datafiles\order_status_filenames.php on line 11.
    
    [02-Nov-2022 15:31:18 Europe/Berlin] Request URI: /xxx.com/, IP address: 127.0.0.1
    #0 C:\xampp\htdocs\xxx.com\includes\classes\simple_categories_tree.php(211): zen_debug_error_handler()
    #1 C:\xampp\htdocs\xxx.com\includes\classes\simple_categories_tree.php(175): SimpleCategoriesTree->getCurrentNavId()
    #2 C:\xampp\htdocs\xxx.com\includes\autoload_func.php(62): SimpleCategoriesTree->init()
    #3 C:\xampp\htdocs\xxx.com\includes\application_top.php(237): require('C:\\xampp\\htdocs...')
    #4 C:\xampp\htdocs\xxx.com\index.php(25): require('C:\\xampp\\htdocs...')
    --> PHP Warning: Undefined array key "cPath" in C:\xampp\htdocs\xxx.com\includes\classes\simple_categories_tree.php on line 211.
     
    [02-Nov-2022 15:31:18 Europe/Berlin] Request URI: /xxx.com/, IP address: 127.0.0.1
    #0 C:\xampp\htdocs\xxx.com\includes\templates\theme871\templates\super_data_head.php(144): zen_debug_error_handler()
    #1 C:\xampp\htdocs\xxx.com\includes\templates\theme871\common\html_header.php(115): require('C:\\xampp\\htdocs...')
    #2 C:\xampp\htdocs\xxx.com\index.php(42): require('C:\\xampp\\htdocs...')
    --> PHP Warning: Undefined variable $fb_image in C:\xampp\htdocs\xxx.com\includes\templates\theme871\templates\super_data_head.php on line 144.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: upgrade question

    I can tell you, your old template will need a TON of work if you want to keep it. You'd be better off with Responsive Classic or Bootstrap.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: upgrade question

    But to answer your other question, errors first then warnings. These warnings will become errors as PHP moves forward so you may as well knock them out now.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Jan 2015
    Posts
    423
    Plugin Contributions
    0

    Default Re: upgrade question

    I have an old template. Trying to do an update without redoing the whole site.

    My error is below. Its seems that whenever i have that piece of code in my old files 1.5.8 does not seem to like it

    This is what on line 115
    <?php if ($_SESSION['customer_id']) { ?>

    Code:
    [02-Nov-2022 20:25:05 Europe/Berlin] Request URI: /xxx.com/index.php?main_page=index, IP address: 127.0.0.1
    #0 C:\xampp\htdocs\xxx.com\includes\templates\theme871\common\tpl_footer.php(115): zen_debug_error_handler()
    #1 C:\xampp\htdocs\xxx.com\includes\templates\theme871\common\tpl_main_page.php(651): require('C:\\xampp\\htdocs...')
    #2 C:\xampp\htdocs\xxx.com\index.php(94): require('C:\\xampp\\htdocs...')
    --> PHP Warning: Undefined array key "customer_id" in C:\xampp\htdocs\xxx.com\includes\templates\theme871\common\tpl_footer.php on line 115.

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: upgrade question

    It's not 1.5.8 that doesn't like it, it's PHP 8.1.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Jan 2015
    Posts
    423
    Plugin Contributions
    0

    Default Re: upgrade question

    you are correct php 8.1 does not like it. Anyone know how to fix?

  7. #7
    Join Date
    Jan 2015
    Posts
    423
    Plugin Contributions
    0

    Default Re: upgrade question

    this seem to solve my issue. Not sure if its the best way to go about it.

    Code:
    <?php if ($_SESSION['customer_id'] = array_key_exists('customer_id', $_SESSION) ? $_SESSION['customer_id'] : null) { ?>

  8. #8
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: upgrade question

    Quote Originally Posted by chadlly2003 View Post
    this seem to solve my issue. Not sure if its the best way to go about it.

    Code:
    <?php if ($_SESSION['customer_id'] = array_key_exists('customer_id', $_SESSION) ? $_SESSION['customer_id'] : null) { ?>
    Eek. Not a good solution...

    The ideal solution as of Zen Cart 1.5.7 is to determine what type of user(s) should have access to what follows.. if only logged in customers, then one option, if guests are allowed to access it, only guests, etc. Otherwise the quick fix for the above is:
    Code:
    if (!empty($_SESSION['customer_id'])) {
    Problem of the previous code change was that the session variable became assigned to the value of the array key existing such that the result was that the session variable basically became a true or a false value instead of the customer_id for that customer. The then next result was that if the key existed the latter Code would execute, if it didn't exist then that Code would be skipped
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: upgrade question

    Or ... to check if someone is logged in
    Code:
    if (zen_is_logged_in()) {
        ...
    }
    ... or if someone is logged in and it's not a guest
    Code:
    if (zen_is_logged_in() && !zen_in_guest_checkout()) {
        ...
    }

  10. #10
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,137
    Plugin Contributions
    11

    Default Re: upgrade question

    Or,....

    Always start fresh on a number jump in the version. When the number changes, as you mentioned at the start
    I noticed that there have been a lot of changes.
    Importing the old database will go smoothly but, you may just miss one of the many important file changes.
    https://myzencarthost.com/index.php?...th-cPanel.html

 

 

Similar Threads

  1. v151 upgrade question
    By ken1 in forum General Questions
    Replies: 3
    Last Post: 1 Mar 2015, 02:03 PM
  2. v139e Upgrade to 1.5.1 question
    By DigitalGuard in forum Upgrading to 1.5.x
    Replies: 10
    Last Post: 9 Aug 2013, 12:29 AM
  3. upgrade question
    By buildingblocks in forum Upgrading from 1.3.x to 1.3.9
    Replies: 3
    Last Post: 4 Oct 2010, 09:34 PM
  4. Upgrade question
    By Linux in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 8 May 2007, 12:45 AM

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