Unexpected error will show on admin interface if there is wrong syntax in custom theme used on frontend (frontend only theme can crash backend)

Path to reproduce:
- install D8 RC2
- create custom theme (working one - checked it to be ONLY FRONTEND THEME - no admin theme)
- add somewhere in line '/' to themename.info.yml (break something in syntax - i add / alone in new line)
- site working and backend working fine!
- clear cache!
- go to '/admin/config/development/performance' and see info about 'unexpected error occur' in admin panel.
- nothing work only if you:
- find bug and remove it.
- clear cache manually

Frontend isn't working because of error in syntax but... backend is dead and this where I see bug.

Option 1:
Fix this bug so theme for frontend can't prevent run admin theme.
Option 2:
Add more clearly info what going on?

This is my first time I write project issue summary. If something is wrong on it I will correct It.

Comments

Patryk Padus created an issue. See original summary.

Patryk Padus’s picture

Issue summary: View changes
Patryk Padus’s picture

Title: Unexpected error after clear cache on admin theme » Unexpected error on backend when syntax error occur in only frontend template
star-szr’s picture

Title: Unexpected error on backend when syntax error occur in only frontend template » Incorrect syntax in frontend theme .info.yml file will throw an error in the backend when clearing caches via the UI
Version: 8.0.0-rc2 » 8.1.x-dev
Issue tags: +TX (Themer Experience)

By default error reporting is not on, it's better for development if you uncomment the lines at the bottom of settings.php that include settings.local.php. Then you can see a more comprehensive error message. If you can post that more comprehensive error message in the issue summary it will be easier to help, but there are definitely cases where we can have better exceptions and exception messages in D8.

Attempting a more specific issue title. If we do anything here it likely wouldn't be in 8.0.x so bumping for now.

star-szr’s picture

PS. Thanks for the report!

Patryk Padus’s picture

Thank you for info and response.
This i get in error.log so its ok. But this information is not avaible on front of me with debug enabled.

I added this:
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

and enable this:
if (file_exists(__DIR__ . '/settings.local.php')) {
include __DIR__ . '/settings.local.php';
}

I have this in error.log:
mod_fcgid: stderr: Uncaught PHP Exception Drupal\\Core\\Extension\\InfoParserException: "Unable to parse themes/main/main.info.yml Unable to parse at line 16 (near "/")." at public_html/core/lib/Drupal/Core/Extension/InfoParserDynamic.php line 30, referer: website.org/admin/config/development/performance

So when parser can't debug website i get this status of response:
The website encountered an unexpected error. Please try again later.

So all info about error won't be shown any more and Drupal use only log file?
This is ok what It be in future?
I hope to see error in website if I enable it in settings and have working backend because it isn't related to it.
It's not clear what to add more to see error not only in log.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Category: Bug report » Support request
Status: Active » Fixed
Issue tags: -Twig +Bug Smash Initiative

This looks like a support request and not a bug.

I think this has been resolved with the explanation on how to enable logging to help the developer given in #4.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.