Disable deprecated warning

8 posts by 2 authors in: Forums > CMS Builder
Last Post: November 22   (RSS)

By kitsguru - November 16

Within CMSB backend and viewer I want to disable Deprecated warnings. What is the best way to do this?

Jeff Shields

By Dave - November 16

Hi Jeff, 

Can you give some more details, are they showing up in the page or in the Developer Log? 

Also, be aware that future versions of PHP may turn deprecated warnings into errors and/or remove the features..   

Dave Edis - Senior Developer
interactivetools.com

By kitsguru - November 16

They show on the page and the log. I use several composer libraries for symphony/twig, symphony/yaml and others. They have deprecated warnings, which I do not care about.

I do not need to see this on the page at any time - either development or production. I have edited the ini file on my development machine

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
Jeff Shields

By Dave - November 17

Hi Jeff, 

Okay, you can disable the logging completely by editing /lib/errorlog_functions.php and setting this to false: 

$enableLogging = true;

Otherwise, if you can let me know which version of PHP you're using and an example of the deprecated errors you're getting I can look into it.  I tried to recreate a few deprecated errors but I don't think I was able to replicate the situation.

Thanks!

Dave Edis - Senior Developer
interactivetools.com

By kitsguru - November 17

Actually what I was thinking was more along the lines of checkboxes to turn on and off the different error flags.

My app uses CMSB viewer functions which traps all errors whether generated by CMSB or other libraries. The deprecated errors are not necessarily CMSB in origin. 

Instead of editing the ini files, htacess or the code base. I would like to be able to enable/disable each of the flags via the Security Panel in CMSB.

I use cypress.io for end to end testing. On the first run after updating any ot the libraries I woiuld want all errors detected. After that I am testing the UI, html validity, accessibility via AXE and broken links. For these tests I do not need deprecated messages as they interfer with the results.

Jeff Shields

By kitsguru - November 20

I run multiple versions of php depending on the client, from version 7.4 to 8.1.

On my development machine (Mac Mini M2 Pro) Sonoma 14.1.1 I use 'sphp switcher' to change versions. I test across all versions. 

On production, I want errors logged except for deprecated warnings. In development, I want to control which errors I see.

As I mentioned, the deprecated warnings are not from CMSB directly but from composer-installed libraries, but CMSB still traps them. These are not issues I can address directly and I don't need to get emails on them or fill up the log.

Jeff Shields

By Dave - November 22

Hi Jeff, 

Can you forward some of the error logs to me via email and/or send me a login (via email)?  I need to recreate the errors so I can work on it.  It doesn't matter if there from composer libraries, we just need to recreate them one way or another.

Thanks!

Dave Edis - Senior Developer
interactivetools.com