User tests: Successful: Unsuccessful:
Closes #29968
READY FOR TESTING
A new custom fatal error page to replace the default symfony error page.
Joomla 4 now uses symfony/error-handler
component for handling fatal errors WHEN DEBUG MODE IS OFF (or in this case, when its not yet been turned on or off by JConfig
)
This is NOT a replacement error page or a duplication of template/system/error.php
. That file will continue to be used for all the reasons its used already. It cannot be used when a fatal error occurs on boot up (and doesnt in Joomla 4 before this PR) because it relies on Joomla being booted, working, and relies on the whole stack working.
fatal-error.html
is displayed when things are REALLY bad and unrecoverable only. Like your database server being offline.
This page is only used during fatal unrecoverable errors, normally at boot time, when it cannot be assumed any of Joomla is working (certainly not a Factory or application running, certainly not a language object available)
It relies on upstream changes I made in the symfony/error-handler
component that have been approved and merged, and that have been made specifically to support the ability of Joomla to render such a custom fatal page and Joomla will be one of the very first the first project to customise the Symfony default error page, when using symfony/error-handler
as a component in another non-symfony stack.
Install Joomla 4 from 4.0-dev
merge/apply #31743 (running npm i
or node build/build.js --build-pages
to be sure)
apply this PR - run composer self-update --1 && composer update
(with v1 of composer)
edit configuration.php and change class JConfig to be class JConfigBroken
Visit your home page.
New screenshots?
This page needs some content https://docs.joomla.org/J4.x:FatalError
Status | New | ⇒ | Pending |
Category | ⇒ | External Library Composer Change Libraries Front End Templates (site) |
Labels |
Added:
?
?
|
Category | External Library Composer Change Libraries Front End Templates (site) | ⇒ | Repository External Library Composer Change Libraries Front End Templates (site) |
THE dependancy change, symfony/error-handler
v5.2 is not released until November 2020
Whats the current date for a freeze for Joomla 4.0.0 ?
I don't have one yet. It may not cut in time. There's a loose aim to get a release out this year. But currently still at least a few more beta's I suspect before we're going to be able to cut a RC
Symfony 5.2 Beta 1 just released with the upstream change needed... one step closer...
https://symfony.com/blog/symfony-5-2-0-beta1-released
I'd be decently confident this will make it before we tag RC for what it's worth and where release blockers are right now
Note to others: do not test until it is declared ready to test. Otherwise just applying the patch causes a fatal error. To fix: remove the line added in diff libraries/bootstrap.php - line 57. Then revert the patch.
Further progress is blocked until Symfony 5.1 is released as this PR has a dependency on changes I contributed upstream in Symfony so that this feature in joomla (and other projects) could happen.
@PhilETaylor Looks like it's out https://symfony.com/blog/symfony-5-2-0-released - so whenever you're ready to get that in we can get this tested and in
@PhilETaylor quick bump
@PhilETaylor since I saved your sunday could you finish this PR please?
haha Sunday :)
What still needs doing to get this past the line? Ive slept a lot since I started this haha.
I would start with upgrading the branch, then changed composer dependencies to ^5.2 and have a look at the css yes ;-)
Thanks to #31743 the work of this PR is simpler.
Please merge/apply #31743 and then apply this PR if you are going to test it.
The result is the same, Symfony 5.2 ErrorHandler can now use the custom template, or a User supplied template or fallback to a PHP text line.
Install Joomla 4 from 4.0-dev
merge/apply #31743 (running npm i
or node build/build.js --build-pages
to be sure)
apply this PR - run composer self-update --1 && composer update
(with v1 of composer)
edit configuration.php and change class JConfig to be class JConfigBroken
Visit your home page.
You should see:
@PhilETaylor marked this pull request as ready for review now
composer drone is not happy, but I don't think that's related to this...
No drone failure is sadly currently correct. They added a dependency here beberlei/assert#286 in the package your updating to 3.3.0. It got removed here beberlei/assert#289 in their 3.2.5 version. But as per beberlei/assert#309 it never made it into the 3.3 branch :(
Because you have the intl dependency on your macbook i think. But that's not a required Joomla dependency. It's not even a dependency for their library (aside from two documented functions - hence the re-removal). I've done a PR to their upstream to fix the issue. But remains on them to merge. beberlei/assert#310
ah yeah, I have intl
installed for legacy zend application use :(
@PhilETaylor so I redid that PR as there was a major refactor of the build tools few days ago and there were a lot of conflicts.
One thing: as there were complains about moving the error pages to the media folder I reverted that part, so it means you have to revert it also here eg:
// Joomla supplied fatal error page
if (file_exists(__DIR__ . '/../../templates/system/fatal-error.html'))
{
$template = file_get_contents( __DIR__ . '/../../templates/system/fatal-error.html');
}
BTW you have also conflicts in this PR
Ive merged 4.0-dev into this branch, but on composer update I get LOADS of upgrade... so paging @wilsonge again.
Package operations: 0 installs, 46 updates, 0 removals
- Downloading behat/gherkin (v4.8.0)
- Downloading phar-io/version (3.1.0)
- Downloading phpunit/phpunit (8.5.14)
- Downloading codeception/codeception (4.1.18)
- Downloading codeception/lib-innerbrowser (1.4.0)
- Downloading php-webdriver/webdriver (1.10.0)
- Downloading codeception/module-webdriver (1.2.0)
- Syncing joomla-projects/joomla-browser (v4.0.0.x-dev b5afd92) into cache
- Downloading joomla/filter (2.0.0-beta5)
- Syncing joomla/mediawiki (dev-master b1750b6) into cache
- Downloading maximebf/debugbar (v1.16.5)
- Downloading phpmailer/phpmailer (v6.3.0)
- Downloading symfony/ldap (v5.2.3)
- Downloading symfony/polyfill-iconv (v1.22.1)
- Downloading wamania/php-stemmer (v2.2.0)
- Downloading nyholm/psr7 (1.4.0)
- Upgrading behat/gherkin (v4.6.2 => v4.8.0): Extracting archive
- Upgrading symfony/polyfill-ctype (v1.20.0 => v1.22.1): Extracting archive
- Upgrading phar-io/version (3.0.4 => 3.1.0): Extracting archive
- Upgrading phpunit/phpunit (8.5.13 => 8.5.14): Extracting archive
- Upgrading codeception/phpunit-wrapper (8.1.3 => 8.1.4): Extracting archive
- Upgrading symfony/yaml (v5.2.1 => v5.2.3): Extracting archive
- Upgrading symfony/finder (v5.2.1 => v5.2.3): Extracting archive
- Upgrading symfony/polyfill-php80 (v1.20.0 => v1.22.1): Extracting archive
- Upgrading symfony/event-dispatcher (v5.2.1 => v5.2.3): Extracting archive
- Upgrading symfony/css-selector (v5.2.1 => v5.2.3): Extracting archive
- Upgrading symfony/polyfill-mbstring (v1.20.0 => v1.22.1): Extracting archive
- Upgrading symfony/polyfill-intl-normalizer (v1.20.0 => v1.22.1): Extracting archive
- Upgrading symfony/polyfill-intl-grapheme (v1.20.0 => v1.22.1): Extracting archive
- Upgrading symfony/string (v5.2.1 => v5.2.3): Extracting archive
- Upgrading symfony/polyfill-php73 (v1.20.0 => v1.22.1): Extracting archive
- Upgrading symfony/console (v5.2.1 => v5.2.3): Extracting archive
- Upgrading codeception/codeception (4.1.12 => 4.1.18): Extracting archive
- Upgrading codeception/module-db (1.0.2 => 1.1.0): Extracting archive
- Upgrading symfony/dom-crawler (v5.2.1 => v5.2.3): Extracting archive
- Upgrading symfony/browser-kit (v5.2.1 => v5.2.3): Extracting archive
- Upgrading codeception/lib-innerbrowser (1.3.4 => 1.4.0): Extracting archive
- Upgrading symfony/process (v5.2.1 => v5.2.3): Extracting archive
- Upgrading php-webdriver/webdriver (1.9.0 => 1.10.0): Extracting archive
- Upgrading codeception/module-webdriver (1.1.4 => 1.2.0): Extracting archive
- Upgrading composer/ca-bundle (1.2.8 => 1.2.9): Extracting archive
- Upgrading fig/link-util (1.1.1 => 1.1.2): Extracting archive
- Upgrading symfony/stopwatch (v5.2.1 => v5.2.3): Extracting archive
- Upgrading symfony/polyfill-php72 (v1.20.0 => v1.22.1): Extracting archive
- Upgrading symfony/options-resolver (v5.2.1 => v5.2.3): Extracting archive
- Upgrading symfony/filesystem (v5.2.1 => v5.2.3): Extracting archive
- Upgrading doctrine/annotations (1.11.1 => 1.12.1): Extracting archive
- Upgrading friendsofphp/php-cs-fixer (v2.17.2 => v2.18.2): Extracting archive
- Upgrading joomla-projects/joomla-browser (v4.0.0.x-dev 679c0ce => v4.0.0.x-dev b5afd92): Checking out b5afd923bf from cache
- Upgrading joomla/console (2.0.0-beta2 => 2.0.0-beta3): Extracting archive
- Upgrading joomla/filter (2.0.0-beta2 => 2.0.0-beta5): Extracting archive
- Upgrading joomla/mediawiki (dev-master d9be7c6 => dev-master b1750b6): Checking out b1750b67c1 from cache
- Upgrading symfony/var-dumper (v5.2.1 => v5.2.3): Extracting archive
- Upgrading maximebf/debugbar (v1.16.4 => v1.16.5): Extracting archive
- Upgrading phpmailer/phpmailer (v6.2.0 => v6.3.0): Extracting archive
- Upgrading symfony/error-handler (v5.2.1 => v5.2.3): Extracting archive
- Upgrading symfony/ldap (v5.2.1 => v5.2.3): Extracting archive
- Upgrading symfony/polyfill-iconv (v1.20.0 => v1.22.1): Extracting archive
- Upgrading symfony/web-link (v5.2.1 => v5.2.3): Extracting archive
- Upgrading wamania/php-stemmer (v2.1.1 => v2.2.0): Extracting archive
- Upgrading beberlei/assert (v3.2.7 => v3.3.0): Extracting archive
- Upgrading nyholm/psr7 (1.3.2 => 1.4.0): Extracting archive
Ive reverted the paths to match your @dgrammatiko changes
Ive reordered the template loading so a custom template can override the joomla supplied one - if file exists
this should be ready again now, except the composer.lock issue
I see the upstream project merge has been done in the last hour so I'll review and revive this PR this week when time allows.
great news
Category | External Library Composer Change Libraries Front End Templates (site) Repository | ⇒ | Repository Administration com_admin SQL Postgresql com_associations com_banners com_categories com_config com_contact com_content |
Labels |
Removed:
?
|
Category | Repository Administration com_admin SQL Postgresql com_associations com_banners com_categories com_config com_contact com_content | ⇒ | Repository External Library Composer Change Libraries Front End Templates (site) |
Labels |
Added:
?
|
Category | Repository External Library Composer Change Libraries Front End Templates (site) | ⇒ | External Library Composer Change Libraries Front End Templates (site) |
@PhilETaylor run composer install symfony/error-handler
instead of just install
One of those days :)
running composer req symfony/error-handler
still seems to touch far too much :(
Ok commits squashed and rebased on 4.0-dev and force pushed (again) ... fingers crossed.
Looks like drone is finally happy with my composer changes - phew.... marking ready for review again with a hope of a LGTM ;-)
I have tested this item
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-04-23 07:34:08 |
Closed_By | ⇒ | wilsonge |
Thanks!
Awesome - thanks!
I like it but am going to wait for the 5.2 tagged version of symfony error handler to be out first! I don't think that will be any sort of issue.