revolution
revolution copied to clipboard
Error message in log: modRestClient::__construct is deprecated
Bug report
Summary
There are deprecated calls to modRestClient::__construct that cause entries in modx error logs.
Step to reproduce
Open your error log and look for the line like this:
Don't know what action triggers this bahaviour, but it pops up on nearly mint MODX installs. In this particular case only ace and moddevtools have been installed, nothing else.
Observed behavior
[2022-04-20 15:03:25] (ERROR in xPDO::getService @ /www/core/xpdo/xpdo.class.php : 1235) modRestClient::__construct is deprecated since version 2.3.0. Use the modRest classes instead. [2022-04-20 15:03:25] (ERROR in modRestCurlClient::__construct @ /www/core/model/modx/rest/modrestcurlclient.class.php : 26) modRestClient::__construct is deprecated since version 2.3.0. Use the modRest classes instead.
I have noticed these errors in a lot of error logs and I expect them to be present in all MODX installations.
Expected behavior
Let modRestClient::__construct rest in piece (pun intended).
Environment
MODX 2.8.3, MODXCLOUD
Cheers,
pepebe
Core itself uses it in the package management, and a proper replacement wasn't added until 3.0. I think it's still worthwhile keeping the deprecated logging in there to alert of non-core uses that need to be fixed to support 3, but I can imagine others might feel differently...
@Mark-H it may be worth logging the name of the component or core that is causing the error. Now from the log it is impossible to understand what this error refers to.
Can we disable deprecated messages from being logged with some setting? Htaccess, php ini etc
Thanks Mark in advance!! https://www.markhamstra.com/modx/2018/deprecated-notices-in-modx-2.7/ ---> log_deprecated 😃