Problem/Motivation

Apologies if this has been reported before, in another form. I tried searching and didn't see any duplicates. I suspect the problem applies to multiple field types, not just images.

I've got a field with multiple images, that I need to appear in a specific order. I just got sent a series of replacement images, like so:

Image 1
Image 2
Image 3
Image 4
Image 5

to be replaced with

Image 1
Image 2a
Image 3
Image 4a
Image 5

If I first upload the images and move them into correct position, like so:

Image 1
Image 2
Image 2a
Image 3
Image 4
Image 4a
Image 5

And then click the Remove button to delete Image 2 and 4, the order I had just set up is lost and I'm left with:

Image 1
Image 3
Image 5
Image 2a
Image 4a

I obviously could just delete image 2 and 4 first, then upload. Or move the images into place after I deleted them. Or save the node before deleting them. I was kind of using the old images as a guide to know where the new ones were supposed to be placed.

Very minor, to be sure, but thought I'd report it. From a UI perspective it's a bit jarring.

Steps to reproduce

Proposed resolution

TBA

Remaining tasks

Search for duplicate issue
Write a test

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-2800981

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TrevorBradley created an issue. See original summary.

vdanielpop’s picture

Assigned: Unassigned » vdanielpop
dashaxiong’s picture

I can confirm this issue. It also occurs when you upload a new image after dragging image fields. The current UI states a subdued warning "*you have unsaved changes". I think this might be solved if the script responsible for dragging fields around can update the data-drupal-selector. I am working on this issue.

dashaxiong’s picture

If we go with the option to update the data-drupal-selector (assuming for the moment that will solve the issue), it would mean that all the following field IDs would need to be updated at the same time. But the number of fields in any given set is unlikely to be too high so this should be okay.

vdanielpop’s picture

Assigned: vdanielpop » Unassigned
vdanielpop’s picture

Issue tags: +DCTransylvania

Version: 8.1.9 » 8.1.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should 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.

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

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

zanvidmar’s picture

Issue tags: -DCTransylvania +ddd2022

zanvidmar’s picture

Status: Active » Needs review
quietone’s picture

Version: 9.3.x-dev » 10.0.x-dev
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Bug Smash Initiative, +Needs issue summary update, +Needs tests

I took a very brief look at this.

@zanvidmar, thank you for making a patch! It would help to comment on what actions you took in making the patch. Such as did you confirm the problem still exists etc.

The issue summary is out of date, in particular there is no proposed resolution, which means that a reviewer will not know if the patch is doing what is intended. I added the standard template to the issue summary and tagged for an update.

Looking at the patch, there is no test, so adding tag for that.

And given the age of the issue, a search for duplicates should be done.

Version: 10.0.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. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.