Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
views.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2015 at 17:48 UTC
Updated:
24 Sep 2015 at 23:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
stefan.r commentedComment #3
stefan.r commentedComment #4
stefan.r commentedComment #5
stefan.r commentedComment #6
stefan.r commentedComment #7
stefan.r commentedComment #8
joelpittetLooks like this is interrupting an existing test. Maybe it needs it's own test method?
Comment #9
joelpittetMoved it into it's own test method. @stefan.r can you boil off any crud in that test that isn't needed as I expect you know what you are testing (I'm only guessing)
Comment #10
joelpittetIs this needed as well?
Comment #14
stefan.r commentedWell I was also wondering about that. The view in the test had no result, so it was only "needed" to test for the string there :)
We could also rewrite the test to actually have results...
Considering this is a text that is used to convey to the user that an exposed filter is required, I am a bit unclear about whether to set it to true by default (which would mean the text will display even if the view has no results).
This is something that has been in views since #535868: Exposed forms as plugins, so I'll see about having a look at that issue and installing an old version of views to find out how this used to behave on no results.
Comment #15
stefan.r commentedFrom digging into the original D6 code it looks like passing along the empty=TRUE option is indeed needed. That old code had the 1 of the 2 bugs this patch found (back then it was indeed $options['content'] and $options['format']), but there was no way to make it work because empty option was not set back then either, so it this 'feature' may have been broken for 6+ years? :)
Basically in the
query()method theInputRequiredexposed form plugin forces an empty result if no exposed filters are applied.The "on demand text" (that used to have as default "Select any filter and click on Apply to see results") will only display if no exposed filters are applied (see InputRequired::preRender()).
But the views area text handler will only render something if either the empty option is enabled ("Display even if view has no result") or if the result is not empty. As the result is always empty, and the empty option is disabled, the text never shows. So I believe we need to set this option here.
I'd also be fine with removing the whole "on demand text" feature, if it never even worked?
Comment #16
stefan.r commentedComment #17
stefan.r commentedComment #18
dawehnerCould and helpful explanation!
Just a general question, do we really want to override all other existing ones, don't we want to append just?
Comment #19
stefan.r commentedupdating IS
Comment #20
stefan.r commentedHmm if we appended we'd need to worry about separators / wrapping them in different HTML elements, and in this case the view isn't actually empty, it's just "fake empty" (the input required plugin does this). So the empty message may or may not be correct -- if applicable, it will currently show up as soon as an exposed filter is selected and the view is still empty. So I think we're fine here and in any case this sounds a bit out of scope for this issue. May be follow-up material as this whole feature is confusing, I don't think "Text on demand" is a thing in English anyway? :P
Comment #22
joelpittetHas tests, improves docs, helps unblock our TranslatedString issue. All goodness.
Comment #23
stefan.r commentedAnd screenshots:
Comment #24
stefan.r commented"to to", can be fixed on commit
s/filters/filter/
Comment #25
joelpittetFixing the comment nits in #24
Comment #26
alexpottCommitted c3c61bc and pushed to 8.0.x. Thanks!