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.
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
Re: PHP warnings in logs directory
In includes/languages/english/YOUR_TEMPLATE/header.php
do you have
define('SEARCH_DEFAULT_TEXT', 'search here');
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');
Re: PHP warnings in logs directory
So that would be a "no." :)
Go ahead and add the line I showed you.
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.
Re: PHP warnings in logs directory
Quote:
Originally Posted by
cnymike
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...
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?
Re: PHP warnings in logs directory
Quote:
Originally Posted by
cnymike
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...
Re: PHP warnings in logs directory
Quote:
Originally Posted by
mc12345678
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?