processwire-issues icon indicating copy to clipboard operation
processwire-issues copied to clipboard

Custom fields for images not saving in frontend editing if inside a repeater matrix

Open Laksone opened this issue 11 months ago • 2 comments

Short description of the issue

Seems like i discovered a bug, where editing custom fields for images are not saving in frontend editing if the image field is inside a repeater matrix. It's also not saving the value when editing the repeater item itself in backend (which obviously is the reason why it's not working in frontend either). The default description field works fine, aswell as editing and saving the page that uses the field.

Code in frontend:

{% for repeaterItem in page.images_test_repeater_matrix %}
    {% for image in repeaterItem.images_test %}
        <img src="{{ image.url }}">
    {% endfor %}

    <edit page="{{ repeaterItem.id }}" field="images_test">
        <button class="btn btn-primary">
            EDIT
        </button>
    </edit>
{% endfor %}

Videos that demonstrate the issue:

https://github.com/user-attachments/assets/266b8c8f-cfd0-4854-a081-5cf1464388f6

https://github.com/user-attachments/assets/a5b65ec6-1eed-44c6-a21f-fe4b0205b3af

Steps to reproduce the issue

  1. Add text field
  2. Add image field (with custom fields activated and the above text field added)
  3. Add repeater matrix (with image field above)
  4. Add template and page with repeater matrix field and upload some images
  5. Find the image gallery repeater item under Admin->Repeaters->... try to edit the custom text field and save
  • ProcessWire version: 3.0.244
  • (Optional) PHP version: 8.3
  • (Optional) MySQL version: 8

Laksone avatar Jan 15 '25 08:01 Laksone

Thanks @Laksone I've pushed a fix for this issue. Can you check if it also corrects it there? Thanks.

ryancramerdesign avatar Feb 06 '25 15:02 ryancramerdesign

Great, it's fixed! Thanks! 👍

Laksone avatar Feb 21 '25 22:02 Laksone