After some recent commit empty messages "thing" is appearing. It happens to all theme, so it's not a theme specific problem. It is easy to see in Bartik by simply editing a node and getting messages to appear. Screenshots attached.
When looking at the markup in all themes, this empty div appears. In Bartik I can a "messages--" class added. After the double dash should be the message type, but that doesn't get set. In side the messages <div>
is a <ul>
with two empty <li>
s.
I also noticed that when there are no messages to render, real or not, the highlighted region appears and it empty. If there is no content, it shouldn't get rendered. This also happens in all themes.
Comment | File | Size | Author |
---|---|---|---|
#32 | 2547127-32.patch | 1.78 KB | legolasbo |
#26 | 2547127-test.patch | 1.18 KB | dawehner |
#26 | 2547127-25.patch | 1.69 KB | dawehner |
#14 | 2547127-14.patch | 604 bytes | Wim Leers |
#10 | Screen Shot 2015-08-06 at 10.42.00 PM.png | 75.07 KB | webchick |
Comments
Comment #2
davidhernandezComment #3
davidhernandezBisecting, I traced it to this commit. #2543332: Auto-placeholdering for #lazy_builder without bubbling
Comment #4
Jaesin CreditAttribution: Jaesin at Chapter Three commentedI've been seeing this intermittently since Beta13 but I haven't tried to debug it yet.
Comment #5
Wim LeersIf #4 is true, then #2543332: Auto-placeholdering for #lazy_builder without bubbling can't be the cause.
Comment #6
Wim LeersI wonder if this is some strange caching problem? Can you please make sure all caches are cleared? Better yet, can you post steps to reproduce on simplytest.me?
I've just reinstalled D8 HEAD to try to reproduce this, but I really can't. :(
Comment #7
benjy CreditAttribution: benjy at PreviousNext commentedI had this issue last night as well, I just did a fresh re-install and it's still there for me at 1569740d0caf3570aeb414a5bbf767bcabca86e4
Screenshot attached
Comment #8
davidhernandezI bisected to that point. I checked out each commit before and after, it definitely lead me to that exact commit. It goes away on the commit before, c3e2000. Anyone care to confirm? Commit b2303ac.
Yes, I clear caches every time. I just tried again.
To reproduce, all I need to do is hit save on a node to get the "...has been updated" message to appear. Other actions that set a message also work.
Regarding the empty highlighted region, that is always there. You can look at the source on any page.
Comment #9
Jaesin CreditAttribution: Jaesin at Chapter Three commentedI updated to HEAD. I can repro easily on my local by clearing the cache with drush and then viewing any page. It looks like it shows up on all content pages the first time I load them after clearing the cache. Then is goes away on subsequent node views.
Comment #10
webchickSteps to reproduce:
1. Make sure you're on the latest, clean 8.x code:
2. Install using Drush:
3. Open some browser you never use (in my case, Safari) in private browsing mode to eliminate caching issues
4. Go to the site front page. Voila.
Comment #11
webchickComment #12
benjy CreditAttribution: benjy at PreviousNext commentedGiven it's a regression, this should probably be critical?
Comment #13
webchickI guess we could make it critical, though I'd be very hard-pressed to not ship D8 if for some reason this was the last one.
However, in reviewing the critical definition: https://www.drupal.org/node/45111#critical it doesn't seem to match any of that criteria. (There's no data loss, security issue, etc. and there is a workaround.) Definitely ugly, user-facing bug tho.
Comment #14
Wim LeersI finally managed to reproduce it.
Requirements to reproduce
This only happens if both of these requirements are met:
sites/default/services.yml
file (during the installation, this file is copied fromsites/default/default.services.yml
), i.e. you still have one without theauto_placeholder_conditions
key in therenderer.config
container parametersettings.local.php
(which sets$config['system.logging']['error_level'] = 'verbose';
)Circumstances in which you cannot reproduce it
settings.local.php
), then you get an actually useful message:Notice: Undefined index: auto_placeholder_conditions in Drupal\Core\Render\Renderer->shouldAutomaticallyPlaceholder() (line 656 of core/lib/Drupal/Core/Render/Renderer.php).
, plus a stack trace.Root cause
This is happening because
sites/default/services.yml
overridescore.services.yml
's container parameters. And because a non-updatedservices.yml
contains['required_cache_contexts' => […]]
as the container parameter, whereas an updated one would contain['required_cache_contexts' => […], 'auto_placeholder_conditions' => […]]
, this causes problems.Because then the compiled container contains this:
So, no
'auto_placeholder_conditions'
key. And hence this causes a notice:Undefined index: auto_placeholder_conditions
.But why no notice and that strange brokenness instead?
_drupal_error_handler()
is called. This is Drupal's error handler._drupal_error_handler_real()
, which generates an "error array", which contains the error type (notice), error message (the undefined index notice), file, line number and backtrace._drupal_log_error()
. This is where things go very wrong.i.e.
$message
is initialized to the empty string.This checks the aforementioned
$config['system.logging']['error_level']
setting, whose default value isERROR_REPORTING_HIDE === 'hide'
. The default value causes_error_displayable()
to returnFALSE
. So we don't enter this branch.… but because this is just a notice, and not a fatal error, we don't enter this branch either. Hence
$message
still equals the empty string.This then finally sets that message… which is just the empty string.
This bug was introduced by #2509898: Additional uncaught exception thrown while handling exception after service changes, which first appeared in beta 13. Which confirms what @Jaesin said that he's been seeing since then, in #4.
Before the changes in that issue, we only ever generated output for a displayable error OR for a fatal error. Now we pretend like we generate output always, but we actually don't. Hence this bug. The first patch to contain this bug is #2509898-21: Additional uncaught exception thrown while handling exception after service changes.
Attached is the solution — very simple :) (Though I may have missed something.)
Comment #15
webchickApplied the patch, repeated steps in #10, no more box!
Comment #16
Wim LeersSo #14 fixes the reported bug.
But, arguably, that bug is just a symptom. The real problem here is that core's container parameters have been updated, but updating from one beta to the next WITHOUT updating your site's
services.yml
can clearly cause big problems. How are we going to fix that problem?That feels like it needs its own issue.
Comment #17
Wim LeersTagging for #16, until that's moved into a separate issue.
Comment #18
Wim LeersTo help people upgrade their existing D8 beta sites correctly, I created a CR that will help prevent the notice: https://www.drupal.org/node/2547351.
Comment #19
webchickI can confirm that after blowing away my old D8 install and git cloning from scratch I no longer am seeing this error.
Comment #20
Jaesin CreditAttribution: Jaesin at Chapter Three commentedThe patch in #14 works for me weather or not I update "renderer.config" my services.yml file.
Updating my services.yml file without the patch does not fix this issue I am experiencing as described in #9.
Comment #21
Wim LeersSo, #16 was discussed on the D8 EU criticals call. Opened a new issue for it: #2547447: Stop creating services.yml by default.
So now this issue is again solely about fixing the bug in
errors.inc
!Comment #22
Wim Leers#20: That sounds impossible :). You probably forgot to rebuild your container (
drush cr
)?Comment #23
Gábor HojtsyAlso seen this error recently. Patch look fine to me! :)
Comment #24
dawehnerWorking on a test now.
Comment #25
davidhernandezSo, what you're saying is that when I pull updates I, and get that stupid permission denied error on default.services.yml, I shouldn't just yell at the computer and fix the permissions? I should actually see what changed in the file? You've gone too far.
I applied the patch, without doing anything else, and the problem went away. I removed the patch and updated my services.yml, which also fixed the problem. Wim for the win!
I still get an empty, rendered highlighted region, but that may be unrelated?
Comment #26
dawehnerOh I've seen that for quite a while and was aways wondering whether the hack this was coming from.
Comment #27
Wim LeersYes, see #953034: [meta] Themes improperly check renderable arrays when determining visibility.
s/exists./exists, which proves that no messages were generated by the error handler, not even an empty one./
-> otherwise the test coverage looks extremely vague.
Missing
\n
.Comment #28
Wim Leers:P :D
Comment #30
Wim LeersComment #31
legolasboClosed #2539200: PHP errors cause empty messages to display when display errors is off as a duplicate.
Also back to Needs work because the feedback from #27 hasn't been implemented yet.
Comment #32
legolasboAttached patch implements the feedback from #27.
No interdiff, because I don't have a development environment on this laptop and manually edited the patch.
Comment #33
Wim LeersLooks great, thanks!
Comment #34
alexpottThis issue addresses a major bug and is allowed per https://www.drupal.org/core/beta-changes. Committed cd7e7ce and pushed to 8.0.x. Thanks!
Comment #36
Gábor HojtsyYay!