Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Mar 2004
    Posts
    136
    Plugin Contributions
    0

    Default PHP warnings in logs directory

    ZC 1.5.6c
    PHP 7.3

    After posting another thread titled "Hundreds of Thousands of MYdebug logs" I realized afterwards that the PHP warning in those errors is pertinent.

    This is the error: "PHP Warning: Use of undefined constant SEARCH_DEFAULT_TEXT - assumed 'SEARCH_DEFAULT_TEXT' (this will throw an Error in a future version of PHP) in /usr/www/users/xxxxxx/store/includes/templates/template_default/sideboxes/tpl_search.php on line 17."

    The site was upgraded to ZC 1.5.6c from ZC 1.5.4 I believe. My client hired someone else to do the upgrade because I was not comfortable doing the upgrade for her. I did however upgrade the PHP version to 7.3 for compatibility issues she was having with her version of WordPress and related plugins.

    I'm not sure how to proceed here but am hoping this is a minor issue to fix.

  2. #2
    Join Date
    Mar 2004
    Posts
    136
    Plugin Contributions
    0

    Default Re: PHP warnings in logs directory

    ZC v1.5.6c
    PHP 7.3

    PHP Warning: Use of undefined constant SEARCH_DEFAULT_TEXT

    I found a thread on GitHub that mentioned this issue and it suggested checking to see if sideboxes/search was turned ON in admin -> tools -> layout boxes controller. Sure enough it was. I turned it off and the MYdebug errors ceased.

    But now I won't see any error logs at all? That can't be good. And of course there won't be a search function anymore in the store in the left column. So how is that a fix?

    Here is that thread in GitHub.
    https://github.com/zencart/zencart/issues/2704
    https://github.com/zencart/zencart/s...H_DEFAULT_TEXT
    Last edited by cnymike; 19 Feb 2020 at 09:03 PM.

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

    Default Re: PHP warnings in logs directory

    In includes/languages/english/YOUR_TEMPLATE/header.php
    do you have

    define('SEARCH_DEFAULT_TEXT', 'search here');
    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
    Mar 2004
    Posts
    136
    Plugin Contributions
    0

    Default Re: PHP warnings in logs directory

    I have this...

    // header Search Button/Box Search Button
    define('HEADER_SEARCH_BUTTON','Search');
    define('HEADER_SEARCH_DEFAULT_TEXT', 'Enter search keywords here');

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

    Default Re: PHP warnings in logs directory

    So that would be a "no." :)
    Go ahead and add the line I showed you.
    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
    Mar 2004
    Posts
    136
    Plugin Contributions
    0

    Default Re: PHP warnings in logs directory

    Yes, that would be a no.

    My Custom template had old code in it. Your code has fixed the issue. Thank you.

  7. #7
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: PHP warnings in logs directory

    Quote Originally Posted by cnymike View Post
    Yes, that would be a no.

    My Custom template had old code in it. Your code has fixed the issue. Thank you.
    Something to take away from that is, if a template provides an override, the override file should be compared against the default ZC version to capture any changes/differences of importance. For example here there was a new/added define that didn't exist in the template. There may also be "new words" to an existing define, so some consideration may be needed to either update that or leave it the same.

    In other files there may be new ways to accomplish an old task, sometimes for very specific reasons, but those should be considered as well...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Mar 2004
    Posts
    136
    Plugin Contributions
    0

    Default Re: PHP warnings in logs directory

    I just had another PHP Warning appear. This one is different and seems to occur during checkout. I'm not able to figure out where the "old" code is located. I'm trying to learn.

    --> PHP Warning: Use of undefined constant SHOW_SHOPPING_CART_DELETE - assumed 'SHOW_SHOPPING_CART_DELETE' (this will throw an Error in a future version of PHP) in /usr/www/users/topiary/store/includes/modules/pages/shopping_cart/header_php.php on line 76.

    Could you please point me in the right direction?

  9. #9
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: PHP warnings in logs directory

    Quote Originally Posted by cnymike View Post
    I just had another PHP Warning appear. This one is different and seems to occur during checkout. I'm not able to figure out where the "old" code is located. I'm trying to learn.

    --> PHP Warning: Use of undefined constant SHOW_SHOPPING_CART_DELETE - assumed 'SHOW_SHOPPING_CART_DELETE' (this will throw an Error in a future version of PHP) in /usr/www/users/topiary/store/includes/modules/pages/shopping_cart/header_php.php on line 76.

    Could you please point me in the right direction?
    That should be in the database as of at least version 1.3.0, maybe sooner. In the admin, you can run the following query from tools->install SQL Patches:
    Code:
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show Shopping Cart - Delete Checkboxes or Delete Button', 'SHOW_SHOPPING_CART_DELETE', '3', 'Show on Shopping Cart Delete Button and/or Checkboxes<br /><br />1= Delete Button Only<br />2= Checkbox Only<br />3= Both Delete Button and Checkbox', '9', '20', 'zen_cfg_select_option(array(\'1\', \'2\', \'3\'), ', now());
    If there are any errors associated with that, my guess is that in copying and pasting from github, my device has added a non-displaying character to the pasted content. Would suggest at that point to copy and paste from a plain text document or to manually type out that line...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    Mar 2004
    Posts
    136
    Plugin Contributions
    0

    Default Re: PHP warnings in logs directory

    Quote Originally Posted by mc12345678 View Post
    That should be in the database as of at least version 1.3.0, maybe sooner.
    Would that indicate that in the upgrade to 1.5.6c that the database was not upgraded?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v156 PHP 7.3 preg_xxxxx Warnings
    By mc12345678 in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 28 Jun 2019, 01:41 PM
  2. Replies: 38
    Last Post: 1 Nov 2018, 09:28 PM
  3. v154 dist_configure.php error on logs directory path
    By strelitzia in forum Bug Reports
    Replies: 5
    Last Post: 3 Feb 2015, 02:10 AM
  4. PHP warnings
    By LEP in forum General Questions
    Replies: 4
    Last Post: 6 Jun 2006, 10:31 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