Duplicate action access check uses a stale real item count

Created on 17 October 2022, over 2 years ago
Updated 4 September 2024, 5 months ago

Problem/Motivation

Field Widget: "Paragraphs (stable)".
The duplicate action access check is called in formElement before the $this->realItemCount is updated in formMultipleElements. This leads to an erroneous access check when paragraph items are removed from the field.

Steps to reproduce

  • Create a new paragraph field with an "Allowed number of values" set to 2.
  • Create a node with the new field.
  • Add a paragraph item to the field.
  • Add another paragraph item to the field.
  • There should now be 2 items.
  • Remove the last paragraph item.
  • There should now be 1 item.
  • BUG: Cannot duplicate the first item. Expected: The duplicate action should be available on the first item.

Proposed resolution

Set the duplicate button access after all the single form elements have been created.

Data model changes

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States recrit

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024