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
Cottser’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.

Cottser’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.