Closed (fixed)
Project:
Paragraphs
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 May 2019 at 14:53 UTC
Updated:
17 Aug 2019 at 11:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sasanikolic commentedI noticed that the delta is cleared correctly with js in Drupal.paragraphsAddModal.openDialog::close(), but it gets added again after the ajax is finished. This patch is a workaround to remove the delta on every $addParagraphButton click, which is bad, but is the only solution I could think of (except writing ugly ajax callback functions). Any other suggestions?
Comment #3
miro_dietikerWhat confuses me is that this problem came already up, so we even should have test coverage.
Maybe it only is triggered with specific extra modules and specific JS?
Otherwise those tests would / should fail.
And then we should simply make sure the delta is only set under the correct situations and not need to apply clean-up workarounds.
Let's make sure this is test covered.
Comment #4
johnchqueI thought there was code already for clearing that hidden field? Was it removed somewhere or it is not being applied anymore?
Comment #5
sasanikolic commentedThere's some code in ParagraphsExperimentalAddWidgetTest that checks the delta, but it is only checking it when we close the modal (which works), not after ajax is executed. This test needs to be expanded. I'm looking into that.
Comment #6
sasanikolic commentedI think this solution would be better. Reverted the workaround.
Comment #7
sasanikolic commentedHere is the patch with the added test.
Comment #8
berdirTest-only patch.
Comment #10
berdirFailed as expected. Fix is a bit strange, but it works, don't have a better idea and we have a test.
Comment #11
berdir