1. Description
P2P Add-on causes the Visual Form Builder to not save when duplicating sections
Expected Behavior: I should be able to duplicate sections of the form and save it, even with the P2P add-on.
Actual Behavior: It doesn't save and, checking the error logs, generates this error:
Reference node with the name "formId" not found - cannot insert new node.
{
"exception": {
"File": "InsertNode.php",
"Line": 58,
"Message": "Reference node with the name \"formId\" not found - cannot insert new node.",
"Code": 0
}
}
  1. Steps to Reproduce
With the P2P add-on active on the website, edit a form using the Visual Form Builder. Duplicate a section then save the form. Saving will result in an error and the form will not be saved.
For forms already made before with duplicate sections, this results in a critical error on the front-end of the form.
  1. Screenshots / Videos
  1. Severity
High (major issue, but a workaround exists)
  1. Environment
Include information about the environment where the bug was encountered:
Device: PC
Browser: Chrome 93
Plugin Version
Core - 3.17.0
P2P - 2.4.3
WordPress Version 6.6.2
PHP Version 8.0
  1. Additional Information
I'm actually not sure how critical it is because this might just be an edge case scenario when someone duplicates a section on a VFB form and the P2P add-on is active.
Moreover, I found a workaround for it. It only happens when you duplicate the blocks. But if you choose a block from the block lists (that creates a section), it doesn't happen.