Comments (4)
@jcogs-design I'm not sure we would want to suppress errors here, then people with PHP in their templates would never know that they needed to fix a problem. It sounds like this is more an issue of some PHP code in a template needing to be updated for PHP 8.2?
from expressionengine.
For sure I don't know if supressing the error is the right thing to do - it is however a way to clean up the mess.
I'm not sure though that simply allowing the php errors (whatever they are) to bleed into the EE output is that helpful either. Sure it alerts you to there being an issue somewhere, but the errors themselves are not that useful.
A better solution perhaps would be to not simply dump inline php into an eval() function and hope for the best (which is, I find, apparently all that EE does). Maybe a better solution would be to make even a primitive attempt to trap errors arising and report them in some more useful fashion: there are plenty of mechanisms that could be used for this - simply exposing the raw output from php's eval() function is not one of them.
from expressionengine.
Few thoughts that might be helpful.
Whenever possible we encourage uses to move PHP out of templates and into plugins (new installs also require a flag in the config to enable PHP in templates). If this is an option I'd head this direction.
It's also best to set the debug level to 0 or 1 so the errors don't display publicly.
Sounds like it might be a good idea for this site to setup logging as well so the errors get recorded to the log file. (Please note, this will still capture errors if debug is set to 0)
My gut is that you would only need to use log_threshold 1 for the example above.. But it might be worth checking a few other options as well.
from expressionengine.
Thanks for the thoughts Tom. As said above I avoid using inline php and suspect the best solution for this case is simply to remove it and do the work in an add-on. More generally however I'm of the view that EE / add-ons / etc should be designed in a way that aims to avoid error handling / reporting that is uncontrolled - so exception errors or php warnings bleeding through - the php try / throw / catch / finally construct appears to make it possible to avoid such in most cases.
from expressionengine.
Related Issues (20)
- An entry with title "Academy Award®" cannot be saved when `Enforce automatic URL title` is enabled
- Email validation in the CP HOT 2
- member_process_reset_password and cp_member_reset_password hooks pass different information when firing ... why?
- Edit Channels - Category tab get: You are not authorized to access this page
- 7.4.9 Categories display issue on publish page
- 7.4.9 File upload replace existing file doesn't create image manips.
- EE 7.4.9 Trying to access array offset on value of type bool ee/legacy/libraries/Image_lib.php, line 1386
- 7.4.9 rte/ckeditor links can be malformed
- Losing Entry Data on Saving Entry Channel with Grid Fields HOT 3
- Stop eecli.php messing up capitalised words when generating addons ...
- RTE ckeditor bullet points css issue
- EE_Relationship_exception Caught HOT 2
- validateNameIsNotReserved validation rule unnecessarily requires add-on to have been called from CP
- Creating a new grid field using ChannelField Model leads to exception error when field accessed HOT 1
- Structure URL does not render trailing slashes to the screen
- dropdowns in RedactorX RTE don't open when editing a page in Preview Mode
- CP Avatars sometimes appearing with double slash
- Deprecation warning - use of null in str_replace - legacy/libraries/File_field.php (840)
- Image url parsing issues - bbcode added and not parsed in text textarea fields on the frontend.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expressionengine.