Re: User tracking mod ZC 1.5.7b / PHP 7.4 Warning: Use of undefined constant
Quote:
Originally Posted by
mc12345678
If I understand correctly there's basically one issue in the above: incomplete attempt to move hard-coded text to a language definition.
I know that my plan was to change the way that line was generated by using sprintf to plug in the content into the text. I had a couple of reasons to do that, one was to allow other css to be easily incorporated (although possibly in the language define) the other was so that the applicable deleted item could be placed in the language statement as appropriate for the language.
I'll prep a solution (commit) and post the link to it shortly.
Please ignore my report about the Admin user still being tracked. I had a typo in my IP in user tracking config. That's what happens when you test at 01H30 :blush:
With a fresh set of eyes I spotted that this morning and everything is fine on that front.
What I don't know is why the warning was generated every time I deleted my admin session last night. I had created the following define in my language file.
PHP Code:
define('TEXT_HAS_BEEN_DELETED', 'IP Address Deleted');
so my output on deleting a session was as expected
Quote:
700a338322f4f6b478fefdb512c43e51IP Address Deleted has been deleted.
This it is the same this morning but I get no warning. No other changes made to my site so strange. At least I now understand why there was no define. :blink: I was scratching my head as I could see no way it would make sense having one but I wondered if the lack of one was the cause of my warning so created one.
Thanks for your prompt replies but as the issue is now only really cosmetic there is no rush to get a fix. I know you have a lot of irons in the fire!
Re: User tracking mod ZC 1.5.7b / PHP 7.4 Warning: Use of undefined constant
Quote:
Originally Posted by
Brent
Thank you that solved the issue.
To test I removed my admin IP so it would be tracked. On deleting the record this then highlighted another warning.
PHP Code:
[31-Jan-2021 00:40:26 UTC] Request URI: /ADMIN/index.php?cmd=user_tracking, IP address: xxx.xxx.xxx.xxx
#1 require(../ADMIN/user_tracking.php) called at [../ADMIN/index.php:11]
--> PHP Warning: Use of undefined constant TEXT_HAS_BEEN_DELETED - assumed 'TEXT_HAS_BEEN_DELETED' (this will throw an Error in a future version of PHP) in ../ADMIN/user_tracking.php on line 267.
Line 267
PHP Code:
$deleted_session_text = $_POST['delsession'] . TEXT_HAS_BEEN_DELETED . ' has been deleted. <br />';
Despite excluding my admin address it is now still being tracked. When I delete I get
Also there doesn't seem to be a define for TEXT_HAS_BEEN_DELETED in the language file?
Quote:
Originally Posted by
mc12345678
If I understand correctly there's basically one issue in the above: incomplete attempt to move hard-coded text to a language definition.
I know that my plan was to change the way that line was generated by using sprintf to plug in the content into the text. I had a couple of reasons to do that, one was to allow other css to be easily incorporated (although possibly in the language define) the other was so that the applicable deleted item could be placed in the language statement as appropriate for the language.
I'll prep a solution (commit) and post the link to it shortly.
Huh, thought this had been posted several hours ago, which is the/a solution to the issue described as well as how that text was double combined rather than made into two separate and unique defines:
Remove hardcoded text to define. · mc12345678/User_Tracking@7d35921 (github.com)
Re: User tracking mod ZC 1.5.8 / PHP 8.0 PHP Deprecated: Call to deprecated function
Just installed on 1.5.8 with PHP 8.0 to see how it would function and all seems OK except for the following depreciated warning. Is there an easy fix?
Code:
Request URI: /index.php?main_page=index&cPath=317, IP address: x.x.x.x
#1 trigger_error() called at [/includes/functions/functions_categories.php:775]
#2 zen_get_categories_name() called at [/includes/classes/observers/class.user_tracking.php:90]
#3 user_tracking->zen_update_user_tracking() called at [/includes/classes/observers/class.user_tracking.php:30]
#4 user_tracking->update() called at [/includes/classes/traits/NotifierManager.php:87]
#5 base->notify() called at [/includes/templates/responsive_classic/common/tpl_main_page.php:267]
#6 require(/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/index.php:94]
--> PHP Deprecated: Call to deprecated function zen_get_categories_name. Use zen_get_category_name() instead in /includes/functions/functions_categories.php on line 775.
Re: User tracking mod ZC 1.5.8 / PHP 8.0 PHP Deprecated: Call to deprecated function
Quote:
Originally Posted by
Brent
Just installed on 1.5.8 with PHP 8.0 to see how it would function and all seems OK except for the following depreciated warning. Is there an easy fix?
Code:
Request URI: /index.php?main_page=index&cPath=317, IP address: x.x.x.x
#1 trigger_error() called at [/includes/functions/functions_categories.php:775]
#2 zen_get_categories_name() called at [/includes/classes/observers/class.user_tracking.php:90]
#3 user_tracking->zen_update_user_tracking() called at [/includes/classes/observers/class.user_tracking.php:30]
#4 user_tracking->update() called at [/includes/classes/traits/NotifierManager.php:87]
#5 base->notify() called at [/includes/templates/responsive_classic/common/tpl_main_page.php:267]
#6 require(/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/index.php:94]
--> PHP Deprecated: Call to deprecated function zen_get_categories_name. Use zen_get_category_name() instead in /includes/functions/functions_categories.php on line 775.
Edit /includes/classes/observers/class.user_tracking.php.
On line 90 of that module, change the function name from zen_get_categories_name to zen_get_category_name.
Re: User tracking mod ZC 1.5.8 / PHP 8.0 PHP Deprecated: Call to deprecated function
Thanks for the quick reply :smile:
That was indeed easy! Change made and functioning perfectly now.
Re: User tracking mod ZC 1.5.8 / PHP 8.0 PHP Deprecated: Call to deprecated function
Quote:
Originally Posted by
Brent
Just installed on 1.5.8 with PHP 8.0 to see how it would function and all seems OK except for the following depreciated warning. Is there an easy fix?
Code:
Request URI: /index.php?main_page=index&cPath=317, IP address: x.x.x.x
#1 trigger_error() called at [/includes/functions/functions_categories.php:775]
#2 zen_get_categories_name() called at [/includes/classes/observers/class.user_tracking.php:90]
#3 user_tracking->zen_update_user_tracking() called at [/includes/classes/observers/class.user_tracking.php:30]
#4 user_tracking->update() called at [/includes/classes/traits/NotifierManager.php:87]
#5 base->notify() called at [/includes/templates/responsive_classic/common/tpl_main_page.php:267]
#6 require(/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/index.php:94]
--> PHP Deprecated: Call to deprecated function zen_get_categories_name. Use zen_get_category_name() instead in /includes/functions/functions_categories.php on line 775.
See the following commit for how this function name change/deprecation is incorporated into the distribution: https://github.com/mc12345678/User_T...21f6d3dec9e222
Re: User tracking mod ZC 1.5.8 / PHP 8.0 PHP Deprecated: Call to deprecated function
Hi, will the latest version be compatible with v2.0+?
Re: User tracking mod ZC 1.5.8 / PHP 8.0 PHP Deprecated: Call to deprecated function
Quote:
Originally Posted by
ideasgirl
Hi, will the latest version be compatible with v2.0+?
Not yet sure what changes need to be made, but as memory serves it does use some of the cookie/session related functionality that has changed to catch up with current operations.
I know also it is possible for this to be improved for capturing admin related operations by tracking whether a record is related to the catalog versus admin. Doing so wouldn't be as descriptive in a multi admin store, but has other benefits.
I expect there would be at least a logged message about the admin screen not using the associated header like file.