Problem/Motivation

The bottom of the Multiple Field Settings section in Views isn’t as clear as it could be, especially on smaller screens.

To replicate the issue:

  • Add a field to a content type, setting the allowed number of values to more than 1
  • Create a View using the content type, setting display format to fields
  • Add the field created above to the View
  • In the Views configuration screen for that field, click on Multiple Field Settings

Proposed resolution

Move the "Reversed" and "First and last" checkboxes down.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

benqwerty created an issue. See original summary.

benqwerty’s picture

Screenshots and patch uploaded.

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.

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.

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.

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.

Kristen Pol’s picture

Priority: Normal » Minor
Issue summary: View changes
Issue tags: +Bug Smash Initiative
FileSize
145.15 KB
132.78 KB

Thanks for the issue and patch.

1) Patch applies cleanly to 9.1.x.

2) Issue without patch was confirmed. See screenshots.

3) Improvement with patch was confirmed. See screenshots.

4) Code change is simple though I'm not sure that is the correct fix.

5) Now that Start from last values is separated on its own line, it might need a period at the end, but I'm not sure so that could be added during commit.

6) New automated tests aren't needed.

7) Dropped to Minor. Leaving as Bug Report but maybe this is better as a Task.

8) Kicking off tests.

Kristen Pol’s picture

Looking at the change more carefully, it seems ok to me. It's just moving the ending </div> from the delta_first_last form field to the delta_offset in order to force the break earlier.

Kristen Pol’s picture

Status: Needs review » Reviewed & tested by the community

Marking RTBC based on the last two comments and that tests are green.

Lendude’s picture

Category: Bug report » Task

Yeah, let's make this a task.

The current situation is very messy indeed, so the 'after' does look better. One thing though, the current situation does make it clear (well ok, clearer at least) that these 3 settings are connected, which does get a little lost in the 'after' situation.

Kristen Pol’s picture

Thanks. Yeah, the grouping is lost but I also think it's easier to grok with the change.

lauriii’s picture

Issue tags: +Usability

It might be worthwhile reviewing this on one of the UX calls

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.

quietone’s picture

It appears that this is retesting the 8.4.x patch. So, I am re-uploading the patch so it tests with 9.2.x

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

I think if we're changing this we need to do a couple of things to make it easier to grok.

  1. We need to move
        // Make the string translatable by keeping it as a whole rather than
        // translating prefix and suffix separately.
        list($prefix, $suffix) = explode('@count', $this->t('Display @count value(s)'));
    

    to just above $form['delta_limit'] = [ so it is closer to where it is used (and then overridden).

  2. We fix a bug introduced by #1261528: Add "First and last only" option to Multiple field settings. We need to remove '#suffix' => $suffix, from $form['delta_reversed'] = [ it has no business being there.
  3. It's tempting to take this opportunity to add
        $form['multiple_field_settings_inline'] = [
          '#type' => 'container',
          '#attributes' => ['class' => ['container-inline']],
          '#fieldset' => 'multiple_field_settings',
        ];
    

    And then move delta_limit and delta_offset to $form['multiple_field_settings_inline']['delta_limit'] and $form['multiple_field_settings_inline']['delta_offset'] respectively. And then change their '#fieldset' => 'multiple_field_settings' to '#parents' => ['options', 'delta_limit'] and '#parents' => ['options', 'delta_offset'] respectively. This would rid of us of have to work out the difference of #prefix and #field_prefix and tidy this up. I think using #parenets is okay here - we do the same in \Drupal\views\Plugin\views\HandlerBase::buildOptionsForm() for the admin label.

anmolgoyal74’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
3.58 KB
2.49 KB

Addressed points mentioned in #17.

anmolgoyal74’s picture

Status: Reviewed & tested by the community » Needs review

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.

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.

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.

ranjith_kumar_k_u’s picture

Rerolled #18

ranjith_kumar_k_u’s picture

changed position of the following code $form['multiple_field_settings_inline'] to just above of the following line $form['multiple_field_settings_inline']['delta_limit']

Status: Needs review » Needs work

The last submitted patch, 25: 2882249-25.patch, failed testing. View results

ranjith_kumar_k_u’s picture

Status: Needs work » Needs review
Asha Nair’s picture

FileSize
57.78 KB
49.68 KB

Applied patch in #27 successfully. Moved the "Reversed" and "First and last" checkboxes down and addressed points mentioned in #17. Adding screenshots for reference

gaurav-mathur’s picture

Assigned: Unassigned » gaurav-mathur
gaurav-mathur’s picture

Assigned: gaurav-mathur » Unassigned
FileSize
22.29 KB
22.21 KB

Hi applied patch#24 on Drupal 10.0.x. patch worked perfectly fine.

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Novice

Thank you @gaurav-mathur but the screenshots were added in #28 so this was duplicated effort.

Reviewing the code

list($prefix, $suffix)
1. Think we shouldn't be using list instead array

Tagging for novice.

benqwerty’s picture

Issue summary: View changes
_utsavsharma’s picture

Tried to address #31.

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.