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)
- xss cleaner is goobering up a title, and I'm not sure how to fix it. HOT 2
- Issues switching from text to number field HOT 1
- When editing the URL Title in the publish tab, the Structure URL is not updated.
- When cloning an entry using Structure, the url_title & the structure_url are given different values.
- Addon Control Panel Routes do not work with multiple segments HOT 3
- php eecms upgrade from 5.4.3 to 6.4.17 fails HOT 1
- {exp:member:memberlist} does not work for secondary roles?
- Deprecation Error - EE6 / php 8.3
- Open HTTP Redirection HOT 3
- Channels with Latin characters transform in entities in Channel's list name
- Super admin delete check using only primary id HOT 2
- 'Choose Existing' causes page to jump to the top HOT 1
- Call to a member function getAllCustomFields() on null HOT 2
- Date field accepts any number and then converts it to default value
- Warning Undefined array key “updating” ee/ExpressionEngine/Service/File/Usage.php, line 59 HOT 1
- Error running Tools - Content Reindex HOT 1
- Changing the case of a template group name, but not the name itself, is not allowed - even if changed name matches actual group folder name.
- Cache_redis missing check on clean method
- HTML5 validation not playing nicely with decimal numbers HOT 2
- eecli generated add-ons won't update if they don't have an mcp file in distribution (even if not needed / used).
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.