Since Paragraphs 8.x-1.12 the popup to add a new paragraph is shown twice.

Used versions:

  • paragraphs_ee: 8.x-1.6
  • paragraphs_features: 8.x-1.9
  • paragraphs: 8.x-1.12

Problem is occurring since #3109571: Hide "Add above" when switching to the behavior tab was committed to paragraphs. Downgrading paragraphs to 8.x-1.11 makes the popup close normally.

CommentFileSizeAuthor
#5 3153820-5.patch701 bytesJeroenT
#4 3153820-4.patch3.98 KBJeroenT
popup_shown_twice.gif535.75 KBJeroenT
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JeroenT created an issue. See original summary.

stBorchert’s picture

Nothing but problems :) ... I try to look into this today.
Thanks for the gif!

stBorchert’s picture

Seems like a larger problem ... the dialog changes by Paragraphs EE are applied to the add-wrapper and a sub-element so there are two dialog definitions now :/

JeroenT’s picture

Status: Active » Needs review
FileSize
3.98 KB

The "paragraphs-add-dialog" class was added multiple times since the add_more element was converted to a container. It was added to the add_more element and the template "paragraphs_add_dialog__categorized". Patch attached removes the attributes element from the template so the class is only added once and the popup will again work as expected.

JeroenT’s picture

FileSize
701 bytes

A smaller change that also fixes the problem.

stBorchert’s picture

google: "how to give 100 issue credits in one commit?" 😉

I'm on vacation right now, but I will test this on monday. If this really works you are my hero. I've looked at the code for several hours and couldnt find a solution.

rgpublic’s picture

I'd give PHP_INT_MAX credits. Hahaha. #5 is nothing but *genius*. A single line. I can't believe it. I also tried to solve this and got lost down a rabbit hole. Thumbs up - works for me!

stBorchert’s picture

Status: Needs review » Fixed

Jeroen, if we ever meet in person please remind me of this and I'll buy you a drink. Or two ... :)

  • JeroenT authored 3d14c0d on 8.x-1.x
    Issue #3153820 by JeroenT: Popup is shown twice since paragraphs 8.x-1....

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rgpublic’s picture

Unfortunately, despite the genius fix by JeroenT, sth. still doesn't seem quite right with the closing of the modal popup when using nested paragraphs. Whenever I have nested paragraphs and I click on "Add Paragraph" on the outer-most paragraph and close that dialog, I get consecutively the modal dialogs of all the sub paragraphs - one by one. Anyone else seeing that problem?