Closed (fixed)
Project:
Layout Paragraphs Limit
Version:
1.0.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Dec 2024 at 20:58 UTC
Updated:
18 Jan 2025 at 21:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sbubaron commentedFull disclosure, I don't really know what I'm doing, but I based these changes off of layout_paragraphs_permissions disable-reorder.js which similarly defines a call to registerLpbMoveError by adding a behavior attachment. The world of drupal javascript and behaviors is quite foreign to me.
this seems to have fixed the console error and is still preventing the movement of paragraphs based on the limit settings.
I don't create patches often so apologies if I messed up the process.
Comment #3
nagy.balint commentedThanks for the report!
I unfortunately could not reproduce it just with layout paragraphs and layout paragraphs limit.
Maybe the issue only appears in Mercury editor.
I think the issue is with the behavior is that technically the behaviors might be called multiple time, and so this registration can happen several times on a page.
So maybe we need to combine this with "once" on the body tag of the page, to make sure that no matter what, this registration only happens once.
Comment #4
nagy.balint commentedHere is a patch with the "once".
Comment #6
nagy.balint commented