@@ -96,7 +96,7 @@ public function export(bool $remove_uuid = false) : array {
9696 return $ item_targetTicket ;
9797 }
9898
99- public static function import (PluginFormcreatorLinker $ linker , $ input = [], $ containerId = 0 , $ dryRun = false ) {
99+ public static function import (PluginFormcreatorLinker $ linker , $ input = [], $ containerId = 0 ) {
100100 if (!isset ($ input ['uuid ' ]) && !isset ($ input ['id ' ])) {
101101 throw new ImportFailureException (sprintf ('UUID or ID is mandatory for %1$s ' , static ::getTypeName (1 )));
102102 }
@@ -120,19 +120,17 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con
120120 }
121121
122122 // set ID for linked objects
123- if (!$ dryRun ) {
124- $ linkedItemtype = $ input ['itemtype ' ];
125- $ linkedItemId = $ input ['items_id ' ];
126- $ linkedItem = $ linker ->findObject ($ linkedItemtype , $ linkedItemId , $ idKey );
127- if ($ linkedItem ->isNewItem ()) {
128- if (strpos ($ linkedItemtype , 'PluginFormcreator ' ) === 0 ) {
129- // the linnked object belongs to the plugin, maybe the item will be imported later
130- $ linker ->postpone ($ input [$ idKey ], $ item ->getType (), $ input , $ containerId );
131- return false ;
132- }
133- // linked item is not an object of Formcreator, it will not be imported
134- throw new ImportFailureException ('Failed to find a linked object to a target ticket ' );
123+ $ linkedItemtype = $ input ['itemtype ' ];
124+ $ linkedItemId = $ input ['items_id ' ];
125+ $ linkedItem = $ linker ->findObject ($ linkedItemtype , $ linkedItemId , $ idKey );
126+ if ($ linkedItem ->isNewItem ()) {
127+ if (strpos ($ linkedItemtype , 'PluginFormcreator ' ) === 0 ) {
128+ // the linnked object belongs to the plugin, maybe the item will be imported later
129+ $ linker ->postpone ($ input [$ idKey ], $ item ->getType (), $ input , $ containerId );
130+ return false ;
135131 }
132+ // linked item is not an object of Formcreator, it will not be imported
133+ throw new ImportFailureException ('Failed to find a linked object to a target ticket ' );
136134 }
137135
138136 // Add or update
0 commit comments