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.
Similar to #2035697: Entity reference formatter should default to the 'Default' view mode.
Related Issues
#2035697: Entity reference formatter should default to the 'Default' view mode
#2057203: Unable to select the 'Default' view mode in views entity area handler
#2057207: Unable to select the 'Default' view mode in views entity row plugin
Comment | File | Size | Author |
---|---|---|---|
#14 | drupal-2057199-14-fail.patch | 1.16 KB | olli |
#14 | drupal-2057199-14-pass.patch | 1.98 KB | olli |
Comments
Comment #1
olli CreditAttribution: olli commentedComment #2
larowlanThanks
Should we expand tests here?
Comment #3
benjy CreditAttribution: benjy commentedTagging, I think tests would be good here.
Comment #4
lauriiiSo we need to create a test for this
Comment #5
lauriiiHere's a test for this.
Comment #6
swentel CreditAttribution: swentel commentedThe test will most likely fail because of #2099417: Unable to change Custom Block view mode - I'm wondering though if it makes sense at all to expose 'Default'. We don't allow this anywhere else with view modes.
Space at the end which should go.
Comment #7
lauriiiWe should run the tests with the patch swentel have applied to #2099417: Unable to change Custom Block view mode
Comment #9
Dave Reid@swentel: See the issue summary. The default view mode is exposed in entity reference and in Views. It was wrong of us *not* to expose it since it's exposed in the Field UI.
Comment #10
lauriiiHere's a patch#5 and swentel's patch in #2099417: Unable to change Custom Block view mode together.
Comment #12
olli CreditAttribution: olli commentedNice work!
Is there a reason why this has to go inside the if?
We should click the "Configure" link instead.
Comment #13
marthinal CreditAttribution: marthinal commentedPatch attached with a possible test that works here #2099417: Unable to change Custom Block view mode
Comment #13.0
marthinal CreditAttribution: marthinal commentedUpdated issue summary.
Comment #14
olli CreditAttribution: olli commentedThe other issue went in. Here's a small test for available view mode options.
Comment #16
olli CreditAttribution: olli commentedComment #17
larowlanReady to fly
Comment #18
webchickCommitted and pushed to 8.x, although I'm concerned given how many other modules have had this problem given the xrefs in the issue summary that this may be the wrong way to fix it. Can default be added after the fact somewhere in field UI if it doesn't already exist? (e.g. $options += array('default' => 'Default')?)
Comment #19
webchick...let's try that again, drupal.org.
Comment #20
Dave ReidIt's not a matter of adding it in the Field UI. It's a matter of all these little places that expose the view modes in some kind of selection. It would be nice if we had some kind of helper function to retrieve a list of view modes for a select box array, that automatically added the 'default' one (and possibly didn't allow view modes that haven't been 'configured' yet to be selected). I'll file an issue for that.