Problem/Motivation

Claro: Views row weight should be a select list

Steps to reproduce

1. Go to any view page, admin/structure/views/view/articles_aside
2. Rearrange filter or sort criteria.
3. Now you can see the weight field is input type text.

Before Patch

Proposed resolution

Row weight field in views should be a select list.

Remaining tasks

User interface changes

Issue fork drupal-3376372

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

Gauravvvv created an issue. See original summary.

gauravvvv’s picture

Status: Active » Needs review
StatusFileSize
new1.42 KB

I have changed the textfield for weight to select list, attached patch for same. please review thanks

smustgrave’s picture

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

Can we add a simple assertion to check if it's a select list.

kostyashupenko’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs tests
StatusFileSize
new37.4 KB

Alt

Patch is working

lauriii’s picture

Status: Reviewed & tested by the community » Needs review

What happens if someone has set arbitrary numerical values for the weight using the textfield? Wouldn't that break when we change to a select?

smustgrave’s picture

Status: Needs review » Needs work

Moving to NW as the tests tag was removed without adding anything

gauravvvv’s picture

Hi @lauriii, if we input an arbitrary numerical value in the weight using a text field, it automatically adjusts to the closest available value. For example, if we enter 15.2, it will change to 15, or to the next available value if any are present before 15.

Mithun S made their first commit to this issue’s fork.

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.