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
Comment #2
Patryk Padus CreditAttribution: Patryk Padus commentedComment #3
Patryk Padus CreditAttribution: Patryk Padus commentedComment #4
star-szrBy 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.
Comment #5
star-szrPS. Thanks for the report!
Comment #6
Patryk Padus CreditAttribution: Patryk Padus commentedThank 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.
Comment #19
quietone CreditAttribution: quietone at PreviousNext commentedThis 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.