Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Major
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
12 Feb 2014 at 02:09 UTC
Updated:
29 Jul 2014 at 23:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunComment #3
sundrupal8.error-handler-container.0.patch queued for re-testing.
Comment #4
dawehner#2160655: Improve error handling of \Drupal class seems also to be an related.
In general hasService('request') seems to also return TRUE, if the request is not set yet onto the container, see Container::has() and getRequestService() on the container. Maybe we should fill an upstream bug report?
At least for request we might actually want to use IntrospectableContainerInterface::initialized() instead?
Comment #5
sunI'm not sure how that would look code-wise in this function? — bear in mind that we can't make any assumptions or rely on anything in the error handler.
For now, I'd recommend to go ahead with this patch; it certainly resolves the last remaining WTFs in our procedural error handler.
In the end, this entire code will (hopefully) be replaced by completely new error/exception handler code in (or attached to)
DrupalKernel.Comment #6
dawehnerWell, there is a semantic difference between has and initialized. While it does not matter for most services it does matter for the request one, see the attached screenshot.

so if we fail during booting or don't have a request at all, we might not fix those issues.
Given that has('request') will always return TRUE we could at least try to check for IntrospectableContainerInterface.
Comment #7
dawehnerYou cannot argue against that, sure.
Comment #8
sunIf I get you right, then we'd have to amend that condition to be
?
Comment #9
dawehnerWe do we not simply use something like:
Comment #10
sunOK, a helper method on \Drupal makes sense to me. Let's simply do both for now? We can always adjust it later. :-)
Comment #11
dawehner+1 for now.
Comment #12
dawehner+1 for now.
Comment #13
alexpottCommitted e71d749 and pushed to 8.x. Thanks!