? ? Success

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
8 Jul 2020

Closes #29968

Summary of Changes

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)

Upstream Dependancy

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.

Testing Instructions

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.

Actual result BEFORE applying this Pull Request

image

Expected result AFTER applying this Pull Request

Screenshot 2020-12-20 at 21 48 39

Documentation Changes Required

New screenshots?

This page needs some content https://docs.joomla.org/J4.x:FatalError

avatar PhilETaylor PhilETaylor - open - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jul 2020
Category External Library Composer Change Libraries Front End Templates (site)
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
Labels Added: ? ?
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jul 2020
Category External Library Composer Change Libraries Front End Templates (site) Repository External Library Composer Change Libraries Front End Templates (site)
avatar wilsonge
wilsonge - comment - 8 Aug 2020

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.

avatar PhilETaylor
PhilETaylor - comment - 9 Aug 2020

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 ?

avatar wilsonge
wilsonge - comment - 9 Aug 2020

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

avatar PhilETaylor
PhilETaylor - comment - 5 Oct 2020

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

avatar wilsonge
wilsonge - comment - 5 Oct 2020

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

avatar ceford
ceford - comment - 18 Nov 2020

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.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30056.

avatar PhilETaylor
PhilETaylor - comment - 18 Nov 2020

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.

avatar wilsonge
wilsonge - comment - 30 Nov 2020

@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

avatar wilsonge
wilsonge - comment - 16 Dec 2020

@PhilETaylor quick bump

avatar HLeithner
HLeithner - comment - 19 Dec 2020

@PhilETaylor since I saved your sunday could you finish this PR please?

avatar PhilETaylor
PhilETaylor - comment - 19 Dec 2020

haha Sunday :)

What still needs doing to get this past the line? Ive slept a lot since I started this haha.

  • CSS the "right" way?
  • Composer dependancy, is this just a case of updating the composer.json?
avatar HLeithner
HLeithner - comment - 19 Dec 2020

I would start with upgrading the branch, then changed composer dependencies to ^5.2 and have a look at the css yes ;-)

avatar PhilETaylor
PhilETaylor - comment - 20 Dec 2020

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.

Testing Instructions

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:

Screenshot 2020-12-20 at 21 48 39

avatar PhilETaylor PhilETaylor - change - 20 Dec 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 20 Dec 2020
avatar PhilETaylor
PhilETaylor - comment - 20 Dec 2020

@PhilETaylor marked this pull request as ready for review now

avatar PhilETaylor PhilETaylor - change - 20 Dec 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 20 Dec 2020
avatar PhilETaylor
PhilETaylor - comment - 20 Dec 2020

composer drone is not happy, but I don't think that's related to this...

avatar wilsonge
wilsonge - comment - 21 Dec 2020

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 :(

avatar PhilETaylor
PhilETaylor - comment - 21 Dec 2020

@wilsonge Don't know what to do then, as a composer update works fine on my machine.

avatar wilsonge
wilsonge - comment - 21 Dec 2020

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

avatar PhilETaylor
PhilETaylor - comment - 21 Dec 2020

ah yeah, I have intl installed for legacy zend application use :(

avatar PhilETaylor
PhilETaylor - comment - 25 Feb 2021

Just an update, this is still blocked by #31743 which needs merging first.

avatar dgrammatiko
dgrammatiko - comment - 25 Feb 2021

@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

avatar PhilETaylor
PhilETaylor - comment - 25 Feb 2021

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
avatar PhilETaylor
PhilETaylor - comment - 25 Feb 2021

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

avatar PhilETaylor
PhilETaylor - comment - 18 Apr 2021

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.

avatar brianteeman
brianteeman - comment - 18 Apr 2021

great news

avatar joomla-cms-bot joomla-cms-bot - change - 20 Apr 2021
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
avatar PhilETaylor PhilETaylor - change - 20 Apr 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 20 Apr 2021
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)
avatar PhilETaylor PhilETaylor - change - 20 Apr 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 20 Apr 2021
Category Repository External Library Composer Change Libraries Front End Templates (site) External Library Composer Change Libraries Front End Templates (site)
avatar dgrammatiko
dgrammatiko - comment - 20 Apr 2021

@PhilETaylor run composer install symfony/error-handler instead of just install

avatar PhilETaylor
PhilETaylor - comment - 20 Apr 2021

One of those days :)

avatar PhilETaylor
PhilETaylor - comment - 20 Apr 2021

running composer req symfony/error-handler still seems to touch far too much :(

avatar PhilETaylor
PhilETaylor - comment - 20 Apr 2021

Ok commits squashed and rebased on 4.0-dev and force pushed (again) ... fingers crossed.

avatar PhilETaylor
PhilETaylor - comment - 20 Apr 2021

Looks like drone is finally happy with my composer changes - phew.... marking ready for review again with a hope of a LGTM ;-)

avatar Quy Quy - test_item - 21 Apr 2021 - Tested successfully
avatar Quy
Quy - comment - 21 Apr 2021

I have tested this item successfully on 9c389a2


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30056.

avatar wilsonge wilsonge - close - 23 Apr 2021
avatar wilsonge wilsonge - merge - 23 Apr 2021
avatar wilsonge wilsonge - change - 23 Apr 2021
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-04-23 07:34:08
Closed_By wilsonge
avatar wilsonge
wilsonge - comment - 23 Apr 2021

Thanks!

avatar PhilETaylor
PhilETaylor - comment - 23 Apr 2021

Awesome - thanks!

Add a Comment

Login with GitHub to post a comment