Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
‘All displays” is the default option, even when there’s only a single display. This is unnecessary and is one more decision a new user has to fret over.
Possible solutions:
Hide “all display/This page” options e.g. filtering when there is only one.
Significantly decrease the visual importance of this functionality.
(This came out from the usability study at BADCamp 2012)
Comment | File | Size | Author |
---|---|---|---|
#64 | after.png | 5.41 KB | pguillard |
#64 | before.png | 10.18 KB | pguillard |
#62 | 1836384-62.patch | 3.84 KB | Lendude |
#62 | interdiff-1836384-55-62.txt | 2.34 KB | Lendude |
#55 | interdiff-1836384-49-55.txt | 762 bytes | Lendude |
Comments
Comment #1
dawehnerLet's do that, unless the user wants to see the master display all the time.
Comment #2
Bojhan CreditAttribution: Bojhan commentedA side from the clear visual bug, which seems to be from another issue. Just hiding this functionality when there are no other displays, or master display sounds sensible.
Comment #3
dawehnerOh right, i worked on two issues at the same time.
For clarity, when you have hidden this field, the button will be called "Apply" all the time.
Comment #5
dawehnerLet's fix the test.
Comment #6
renat CreditAttribution: renat commentedIt would be nice to have a possibility to show this option even if there is just one display (probably admin/structure/views/settings is a right place for appropriate switch). It is useful in case you know other displays will be added in the future, using it you can decide what should be cloned to this displays, and what should not.
In principle it should be possible with Master display, though... Would be interesting to hear a word from other people about their workflows in such cases.
Comment #7
dawehnerAnother classical example that you can't oversimplify what people are doing with views.
Comment #8
dawehner#5: drupal-1836384-5.patch queued for re-testing.
Comment #10
dawehner#5: drupal-1836384-5.patch queued for re-testing.
Comment #12
dawehner#5: drupal-1836384-5.patch queued for re-testing.
Comment #14
dawehner#5: drupal-1836384-5.patch queued for re-testing.
Comment #15
Bojhan CreditAttribution: Bojhan commentedtagging
Comment #16
damiankloip CreditAttribution: damiankloip commentedrerolled, looks good and works fine.
Comment #18
Bojhan CreditAttribution: Bojhan commented@damain could you reroll this?
Comment #19
damiankloip CreditAttribution: damiankloip commentedYep, sure.
Comment #20
damiankloip CreditAttribution: damiankloip commentedPatch applied ok, this should fix the test failure.
Comment #21
klonosComment #22
jhedstromComment #23
jain_deepak CreditAttribution: jain_deepak commentedRerolled
Comment #25
gaurav_varshney CreditAttribution: gaurav_varshney commentedComment #27
dawehnerNow we just have to fix the failures :)
Comment #28
anil280988 CreditAttribution: anil280988 commentedRerolled
Comment #29
anil280988 CreditAttribution: anil280988 commentedComment #31
tadityar CreditAttribution: tadityar commentedTrying to pass.
Comment #33
hynnot CreditAttribution: hynnot commentedNeeds review.
Comment #34
alimac CreditAttribution: alimac commentedRemoving location tag -- there was a discussion (see 2407325#comment-9513533 and decided to use one tag to keep the autocomplete list of tags short.
Comment #36
hynnot CreditAttribution: hynnot commentedNeeds review.
Comment #37
dawehnerYou could show that in just a single line, right?
'#access'] = !\Drupal::config('views.settings')->get('ui.show.master_display') && count($displays) > 2;
Comment #38
manningpete CreditAttribution: manningpete commentedPatch applies.
Comment #39
tadityar CreditAttribution: tadityar commented@dawehner, isn't that an if statement?
Comment #40
LendudeI agree with @tadiyar, it's an IF statement so it should be in curly brackets.
Could I add one more twist to this? Only remove the field when the section is not currently overridden.
Scenario:
- Add View
- Add two Pages
- Override the Field section in Page 2
- Delete Page 1
With the patch in #36 the user would now NOT get the option to revert the Field section in Page 2 back to default (because there is only one display left).
So add an additional check to see if the current section in overridden, and if so. don't hide the field.
Comment #42
LendudeThe failed tests show another issue with the fix in #36. Setting #access to FALSE actually translates to 'overridden' and not 'default'.
getOverrideValues() only checks if a value is set, and doesn't check #access. So when adding anything in the UI you will end up with a section that no longer uses the defaults.
The new patch does the check earlier and doesn't add the override field at all, like it is done for the default display.
Interdiff is against #36
Let's see what this does...
Comment #45
pguillard CreditAttribution: pguillard commentedA light re-roll from #42...
Comment #48
dawehner@pguillard Oh cool, thank you for rerolling this patch. I
I think we need some additional testing for the new behaviour. Maybe in
\Drupal\views_ui\Tests\DisplayTest
we already have some tests about the dropdownComment #49
pguillard CreditAttribution: pguillard commentedCool
I guess we have dropdown tests :
I just corrected one test, I don't know for the remaining error!
Comment #50
pguillard CreditAttribution: pguillard commentedto not consider..
Comment #53
LendudeThe change in the interdiff in #49 doesn't appear to be in the patch? Am I missing something?
Comment #54
pguillard CreditAttribution: pguillard commented@Lendude : You are right, that line was braking the tests, it was mentioning test_store_pager_settings before we get the view.
Feel free to take control!
Comment #55
LendudeThis should get it back into the green. Will look into adding more tests per #48.
Comment #56
LendudeComment #57
pguillard CreditAttribution: pguillard commentedI guess this is RTBC !
Comment #59
pguillard CreditAttribution: pguillard commentedComment #60
pguillard CreditAttribution: pguillard commentedBack to RTBC...
Comment #61
alexpottI might be wrong but I can't see any tests confirming that the "all Displays" option is not displayed as expected.
Comment #62
Lendude@alexpott you are absolutely right.
Added tests and removed unrelated extra newline.
Comment #63
pguillard CreditAttribution: pguillard commentedComment #64
pguillard CreditAttribution: pguillard commentedI guess this is RTBC.
Before patch :
After patch :
Comment #65
dawehner+1
Comment #66
alexpottCommitted c536cbf and pushed to 8.1.x and 8.2.x - as a task this is not eligible for 8.0.x but this is safe for 8.1.x-beta1. Thanks!
Comment #70
Gábor HojtsyThanks, removing from UX sprint now.