In D7, it was possible to override settings (Format settings, Show settings, Pager settings, ...) directly without explicitly mark the related parameter to (Format, Show, Pager, ...) to be overridden.

d7

d8

The only way to override these settings in D8 is to edit the parameter and mark it as "override" even it is the same as other display. Settings can then be edited for this display only.

It is not really intuitive and looks like a regression.

Issue fork drupal-2552541

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vbouchet created an issue. See original summary.

vbouchet’s picture

Issue summary: View changes
StatusFileSize
new42.05 KB
jibran’s picture

Title: Override settings per display » Regression: Missing override settings per display
Category: Feature request » Bug report

It is a regression.

vbouchet’s picture

Assigned: Unassigned » vbouchet
Status: Active » Needs review
StatusFileSize
new924 bytes

Please find a patch which should fix this regression. It is based on D7 definition of defaultable sections.

vbouchet’s picture

Assigned: vbouchet » Unassigned

Status: Needs review » Needs work

The last submitted patch, 4: regression_missing-2552541-4.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: regression_missing-2552541-4.patch, failed testing.

vbouchet’s picture

Status: Needs work » Needs review
StatusFileSize
new2.19 KB

I updated the patch as the feed plugin is overriding default values to disallow style and row settings.

Status: Needs review » Needs work

The last submitted patch, 9: regression_missing-2552541-9.patch, failed testing.

peacog’s picture

Status: Needs work » Needs review

The patch fixes the bug for me. It applies cleanly on 8.1.x too.

Status: Needs review » Needs work

The last submitted patch, 9: regression_missing-2552541-9.patch, failed testing.

peacog’s picture

Title: Regression: Missing override settings per display » Cannot have different Style options or Row style options per display
Priority: Normal » Major
Related issues: +#2677504: Views Format Grouping cannot be unique per Display

I'm updating the title and priority of this in the hope of getting some more eyes on this issue. I consider it to be a reasonably serious bug as it makes it impossible to have different style options for different displays in a view.

Example using Style options

  1. Create a view with two displays showing rows as Fields.
  2. In the first display set a grouping field in Format: settings.
  3. The second display will also be given the same grouping field.

Example using Row style options

  1. Create a view with two Page displays showing rows as Content. By default each display will have View mode set to Teaser.
  2. In the first display change View mode to Default
  3. The second display's View mode will also be changed to Default

The patch in #9 fixes the bug but it causes a number of test failures relating to the views module config schema. It looks like the 'style_options' and 'row_options' sections added by the patch need corresponding settings in /core/modules/views/config/schema/views.data_types.schema.yml. I have tried out a few things in views.data_types.schema.yml but I don't really know what I'm doing. Hopefully someone else will take a look.

dsquaredb’s picture

After applying the patch in #9, I made two changes to /core/modules/views/config/schema/views.data_types.schema.yml to replace [%parent.type] in lines 92 and 101 with [plugin_id]. This seems to be working, but I have never submitted a patch, am hesitant to try one against a core module, and so don't know what tests it might fail.

peacog’s picture

@DSquaredB, I tried your suggestion, but it throws up an error in Drupal\views\Tests\Wizard\BasicTest. If you'd like to try something else it's not necessary to run the entire test suite, which can take forever in a local development environment. You just need to enable the Testing module and run the failing tests, which are:

  1. Views.Drupal\views\Tests\Wizard\BasicTest
  2. Views.Drupal\views\Tests\Wizard\ItemsPerPageTest
  3. Views_ui.Drupal\views_ui\Tests\DisplayTest
  4. Views_ui.Drupal\views_ui\Tests\OverrideDisplaysTest
  5. Views_ui.Drupal\views_ui\Tests\WizardTest

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

peacog’s picture

Title: Cannot have different Style options or Row style options per display » Improve usability when overriding Views style options and row style options
Category: Bug report » Task
Priority: Major » Normal
Status: Needs work » Active

Revisiting this issue a few months later and with more D8 experience I now see that my original opinion that this is a bug was wrong. You can indeed have different Style and Row style options per display, but the way to do it in D8 is not the same as in D7. In D7 you could override the default settings from both Format: and Format: settings, and from both Show: and Show: settings. In D8 you must override Format: if you want different format settings per display, even if the format of all displays is the same. The same method of overriding display settings is used for other Views settings too, like page access settings and exposed form settings.

While this is a usability issue for people coming from D7, it's not a bug. Usability could be improved by adding some help text on the options forms of non-overridden displays, warning the user that any changes made to the display will apply to all displays that have not overridden the default settings. Changing the category to Task.

peacog’s picture

Version: 8.1.x-dev » 8.2.x-dev
Status: Active » Needs review
Issue tags: +Usability
StatusFileSize
new2.29 KB

As per #17 here's a patch that displays a warning on the Style and Row style options forms.

Status: Needs review » Needs work

The last submitted patch, 18: views-options-override-usability-2552541-18.patch, failed testing.

peacog’s picture

Status: Needs work » Needs review
StatusFileSize
new2.39 KB
new1.78 KB

Fixed failing tests.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

lendude’s picture

Title: Improve usability when overriding Views style options and row style options » Improve usability when overriding Views style options and row style options and pager options
StatusFileSize
new4.21 KB

I'm moving the patch over from #2824314: List wrapper class shared between view displays which follows the same line as the patches in #9 and earlier. I think not being able to override displays from these modals is a regression and annoying, and there is really no good reason for it not to be possible.

Quoting myself from the other issue:
This was apparently removed in #2331793: Changing pager settings for this display only also changes pager settings for other display but I can't really see how removing it was seen as a valid fix for the described problem. It prevented the problem from manifesting by removing existing (useful) functionality.

So lets get this back in.

davps’s picture

#25 applied and works fine.

Tested on 'Table' format settings.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

antiorario’s picture

StatusFileSize
new4.49 KB

Rerolling patch for compatibility with newer versions.

antiorario’s picture

StatusFileSize
new4.49 KB

Once again, since apparently I can't count.

honza pobořil’s picture

Patch #30 works on 8.7.1

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

aperedos’s picture

Patch #30 works fine on 8.8.2

joanpebupe’s picture

Patch from #30 works like a charm for 8.8.2.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela credited Alex72RM.

pameeela credited Pawlus.

pameeela credited xjm.

pameeela’s picture

Closed a couple of duplicates in favour of this one so adding credit for the other contributors.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

anushrikumari’s picture

StatusFileSize
new4.38 KB

Rerolled patch #30 for 9.2.x

Status: Needs review » Needs work

The last submitted patch, 41: 2552541-41.patch, failed testing. View results

Pooja Ganjage’s picture

StatusFileSize
new4.31 KB

Hi,

Creating a patch for solving issue as raised in #41 comment and update deprecated method as assertFieldByName() mentioned in #41 patch.

Please review the patch.

Thanks.

Pooja Ganjage’s picture

Status: Needs work » Needs review
tanubansal’s picture

Tested #43 on 9.1, changes are visible
RTBC + 1

aslaymoore’s picture

Tested #43 on 9.1.3. The option to apply to either an individual view display or all view displays appears at the top. Also seems to work properly on save of the changes as well.

RTBC + 1

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

snaphuman’s picture

#43 tested on core v9.2.10 and works pretty well! RTBC +1

¿Could this patch be included to the development stream of views?

Thanks for the effort.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

StatusFileSize
new2.29 KB
new4.19 KB

Rerolled for 9.5

junaidpv’s picture

#51 worked good!

smustgrave’s picture

If you feel it worked can you post the testing steps you did and move to review tested by community

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Self review

This will need an upgrade path for the new configuration for existing sites.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

simobm’s picture

Version: 11.x-dev » 9.5.x-dev

#51 did not work for me on 9.5.9.

I've created a view of a Solr index, a unformatted list of rendered entities. Once i change the view mode on one of them, the other one changes its view mode too.

smustgrave’s picture

FYI 11.x is the current development branch so issues will have to be committed there first before it's considered for backport to 9.x

simobm’s picture

Version: 9.5.x-dev » 11.x-dev

Thanks @smustgrave i didn't know that.

trackleft2 made their first commit to this issue’s fork.

trackleft2’s picture

Hey @smustgrave I've updated this issue with a merge request.
To create the merge request I applied https://www.drupal.org/files/issues/2022-07-26/2552541-51.patch to the 11.x branch and then added an update function for updating existing views on sites that were not using this patch.

See https://git.drupalcode.org/project/drupal/-/merge_requests/6706/diffs

The need for a database update is up for debate.

trackleft2’s picture

Status: Needs work » Needs review

I think this is now ready for review with one outstanding question.

- Is the comment about an upgrade path in #55 valid or not.

There is a new update in the views.install file for review if it is.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs upgrade path tests

Thanks for carrying this forward.

Left a comment on the MR but post_update hooks also requires test coverage. Should be a few examples in the views module that may help.

trackleft2’s picture

Status: Needs work » Needs review

OK, I've updated the install file update function to use hook_post_update_hook and added a test for the update. https://git.drupalcode.org/project/drupal/-/merge_requests/6706/diffs

trackleft2’s picture

Status: Needs review » Needs work

NVM tests failed

joegraduate made their first commit to this issue’s fork.

xjm’s picture

Amending attribution.

hmdnawaz’s picture

StatusFileSize
new18.35 KB

patch from MR for 11.2

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.