tsgrp / HPI

OpenContent Management Suite (OCMS)
http://www.tsgrp.com/products
17 stars 5 forks source link

Copy Form: Copied supporting docs deleted (as well as relation b/w form and doc) upon editing form. #2352

Closed nreiman closed 3 years ago

nreiman commented 3 years ago

The "Copy Form" action allows users to choose whether or not to copy the supporting docs as well. When the action is executed and this option is true, the supporting docs are copied over as expected. However, upon editing the form, all but the first copied over supporting docs are deleted, as well as their relationships to the form.

nreiman commented 3 years ago

Original Enhancement GH Link: https://github.com/tsgrp/HPI/issues/2218

nreiman commented 3 years ago

Updated copied supporting doc ids list to be a map. Original code looped through the list incorrectly and there was no way to tell which object id went with which supporting doc. The map contains the object names and correlating object ids of the newly copied supporting docs. The map is used to replace the original supporting doc ids w/ new supporting doc ids in the PSI JSON. The new copied form's PSI JSON is now updated correctly - so when the logic that checks for valid supporting docs in the PSI JSON is hit all copied supporting docs should be valid.

Tested with supporting docs of same name in both Alfresco and Documentum.

OC Rev: 26721 CR: dvora, kgarelli