backdrop-contrib / paragraphs

Paragraphs module to control your content flow
https://backdropcms.org/project/paragraphs
GNU General Public License v2.0
5 stars 11 forks source link

Multi-value paragraph fields have an extra editor instance #134

Closed allsite closed 5 months ago

allsite commented 2 years ago

I have a paragraph field "long text format" that can have an unlimited amount of values. The screenshot below reflects two blank values, with no way to remove them individually. They do get saved to the database. Every time I edit the node with this paragraph, it adds another blank value to the database. I have over a dozen of these blank "Text" field values and it continues to grow by 1 each time the node is updated.

The expected behavior would be to have no Text editors, until the "Add Value" button is clicked. Similar to how the "add another" button works now, but with a different label.

In terms of saving these values, I believe it should not be saving empty values to the database. This part is critical, as it would fix the issue of these values growing +1 every time the node gets updated.

(screenshot reflects a new node, no buttons clicked) Screenshot 2022-04-21 011410

(screenshot of expected behavior) Screenshot 2022-04-21 012733

allsite commented 2 years ago

After more testing, it seems to function as expected as plain text (no CKE editor). Perhaps it could check for empty ['value']? Or maybe this isn't a paragraphs bug.

laryn commented 2 years ago

@allsite A few follow up questions:

  1. Does the text field have any value in the "Default value" settings, even if it's spaces added to the WYSIWYG interface?
  2. Does this happen to a multi-value text field that is added to a regular content type rather than a Paragraph, or just when added to a Paragraph?
  3. Does this relate to the "Required" status at all? (if you test by removing the "Required" status does it still occur?)
allsite commented 1 year ago

@laryn

Hi Layn, I ran a few tests on a different install. Here's what I discovered.

The empty input widgets only start to accumulate when Filtered Text is enabled on the multi value field.

Simply edit, save, repeat - you should end up with a wall of empties, given the two conditions from above are in play.

It doesn't seem a default value is related, as I verified there was nothing configured (no space). If it is technically related it doesn't appear to be an issue with field config.

I didn't have a chance to test with Paragraphs yet, but it seems unrelated considering it occurs in core. That was just where I initially detected the problem.

The field is not required when the issue occurs. When required, I entered a value into the single box, saved. Going back and editing/saving did not produce extra boxes and worked as expected.

So in summary, Filtered Text, Unlimited Values, Not Required appears to be the recipe for this issue, demonstrated by edit/save/repeat.

Let me know if you'd like me to test anything else.

argiepiano commented 1 year ago

I can confirm that this seems to be a core bug. @allsite, are you willing to open a bug report in the main backdrop-issue repo?

argiepiano commented 1 year ago

Actually this has been reported (but not fixed) in the core queue. https://github.com/backdrop/backdrop-issues/issues/5153

allsite commented 1 year ago

Actually this has been reported (but not fixed) in the core queue.

https://github.com/backdrop/backdrop-issues/issues/5153

Excellent. Thanks for adding the reference.

laryn commented 5 months ago

Closing here, since this is a core bug. Thanks, all!