Problem/Motivation

When re-ordering images the new weights are not saved

Steps to reproduce

  1. Edit an entity
  2. re-order images
  3. observe the order is not saved

Issue fork fiu-3422202

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

akhoury created an issue. See original summary.

akhoury’s picture

StatusFileSize
new372 bytes
shevgeny’s picture

The module without the patch doesn't sort images at all, with the patch - it sometimes sorts, sometimes doesn't.

liukevich’s picture

Hello! I solved the problem this way. (Drupal 10.2.3)

Edit file: "modules/fiu/templates/fine-image-widget.html.twig"
After (~38 lines):

{% if data.title %}
   {{ data.title }}
{% endif %}

Add:

{% if data._weight %}{{ data._weight }}{% endif %}

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

rishabjasrotia’s picture

StatusFileSize
new1.55 KB
divya.sejekan’s picture

Status: Needs review » Needs work

Tried with both MR's , The changes are not reflected . Still the sort is not working

rishabjasrotia’s picture

StatusFileSize
new3.53 KB

Hello @divya.sejekan please use the latest patch added I have tested it in plain drupal setup.
It is working as needed.

rishabjasrotia’s picture

Assigned: akhoury » Unassigned
Status: Needs work » Needs review
gfarishyan’s picture

StatusFileSize
new2.07 KB

I'm attaching file which will fix issue not only when _weight is a select but also when it's input.
Also _weight field should be excluded in fine-image-widget.html as drupal data already renders it.

divya.sejekan’s picture

StatusFileSize
new138.43 KB
new410.68 KB
new138.36 KB
new422.37 KB

Patch in #11 seems to work -> fiu-re-order-5.patch . The order of the image is changeable and sorting works , and is displayed the same in view page
RTBC++