-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail gracefully when errors are detected #251
Conversation
Hmm, not sure why this is failing - |
|
Jenkins re test this please |
@christianwach I have a server to test with multiple obsolete php versions. The code looks good - once the linting error is updated and the file name question is taken care of I can test. Thanks for this it's a great improvement |
Jenkins re test this please |
@christianwach now civilint finds these issues https://test.civicrm.org/job/CiviCRM-WordPress-PR/180/checkstyleResult/new/ |
@seamuslee001 Oh my. There must be something screwy with my |
Jenkins re test this please |
Ah dammit, going to have to go through all the files individually it seems. |
@christianwach Thanks for this. On an Applying the patch brings us to an info page and we do not crash the site, the admin. Upgrade php, reload and the upgrader works as expected. |
Overview
Rewrites the error checking that the WordPress plugin performs and fails gracefully instead of throwing fatal errors and making WordPress inoperable. Introduces a "CiviCRM Troubleshooting" page to help diagnose and fix problems.
Before
When the PHP version was less than the required version, CiviCRM would call
wp_die()
and make WordPress inoperable. Other error checking duringinitialize
was either never performed or never acted upon.After
New framework for handling errors that provides a configurable "CiviCRM Troubleshooting" page to help diagnose and fix problems when they are encountered.
The plugin header
Requires PHP:
parameter prevents installation when an insufficient PHP version is detected. However, this does not handle the same situation after a CiviCRM upgrade. This Troubleshooting page is now shown instead of CiviCRM's admin UI:It's more difficult to handle broken file systems - but, where possible, the following Troubleshooting page is now shown instead of CiviCRM's admin UI. (Try renaming
civicrm/CRM/Core/Config.php
tocivicrm/CRM/Core/Config.php.bak
to see this page)Whilst not complete in its coverage of possible errors, this code can be developed to be more comprehensive in future. The major improvement is that WordPress does not stop functioning whilst problems are attended to.