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
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.
Comment | File | Size | Author |
---|---|---|---|
#33 | 2882249-33.patch | 3.31 KB | _utsavsharma |
| |||
#33 | interdiff_31-33.txt | 780 bytes | _utsavsharma |
#30 | 2882249-afterpatch.jpg | 22.21 KB | gaurav-mathur |
#30 | 2882249-beforepatch.jpg | 22.29 KB | gaurav-mathur |
#28 | afterpatch.png | 49.68 KB | Asha Nair |
Comments
Comment #2
benqwerty CreditAttribution: benqwerty as a volunteer commentedScreenshots and patch uploaded.
Comment #9
Kristen PolThanks 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.
Comment #10
Kristen PolLooking at the change more carefully, it seems ok to me. It's just moving the ending
</div>
from thedelta_first_last
form field to thedelta_offset
in order to force the break earlier.Comment #11
Kristen PolMarking RTBC based on the last two comments and that tests are green.
Comment #12
LendudeYeah, 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.
Comment #13
Kristen PolThanks. Yeah, the grouping is lost but I also think it's easier to grok with the change.
Comment #14
lauriiiIt might be worthwhile reviewing this on one of the UX calls
Comment #16
quietone CreditAttribution: quietone as a volunteer commentedIt appears that this is retesting the 8.4.x patch. So, I am re-uploading the patch so it tests with 9.2.x
Comment #17
alexpottI think if we're changing this we need to do a couple of things to make it easier to grok.
to just above
$form['delta_limit'] = [
so it is closer to where it is used (and then overridden).'#suffix' => $suffix,
from$form['delta_reversed'] = [
it has no business being there.And then move
delta_limit
anddelta_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.Comment #18
anmolgoyal74 CreditAttribution: anmolgoyal74 at OpenSense Labs for DrupalFit commentedAddressed points mentioned in #17.
Comment #19
anmolgoyal74 CreditAttribution: anmolgoyal74 at OpenSense Labs for DrupalFit commentedComment #24
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedRerolled #18
Comment #25
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedchanged position of the following code
$form['multiple_field_settings_inline']
to just above of the following line$form['multiple_field_settings_inline']['delta_limit']
Comment #27
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #28
Asha Nair CreditAttribution: Asha Nair at Zyxware Technologies commentedApplied patch in #27 successfully. Moved the "Reversed" and "First and last" checkboxes down and addressed points mentioned in #17. Adding screenshots for reference
Comment #29
gaurav-mathur CreditAttribution: gaurav-mathur at Dotsquares Ltd. commentedComment #30
gaurav-mathur CreditAttribution: gaurav-mathur at Dotsquares Ltd. commentedHi applied patch#24 on Drupal 10.0.x. patch worked perfectly fine.
Comment #31
smustgrave CreditAttribution: smustgrave at Mobomo commentedThank 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.
Comment #32
benqwerty CreditAttribution: benqwerty as a volunteer commentedComment #33
_utsavsharma CreditAttribution: _utsavsharma at OpenSense Labs for DrupalFit commentedTried to address #31.