@@ -96,7 +96,7 @@ public function export(bool $remove_uuid = false) : array {
96
96
return $ item_targetTicket ;
97
97
}
98
98
99
- public static function import (PluginFormcreatorLinker $ linker , $ input = [], $ containerId = 0 , $ dryRun = false ) {
99
+ public static function import (PluginFormcreatorLinker $ linker , $ input = [], $ containerId = 0 ) {
100
100
if (!isset ($ input ['uuid ' ]) && !isset ($ input ['id ' ])) {
101
101
throw new ImportFailureException (sprintf ('UUID or ID is mandatory for %1$s ' , static ::getTypeName (1 )));
102
102
}
@@ -120,19 +120,17 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con
120
120
}
121
121
122
122
// 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 ;
135
131
}
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 ' );
136
134
}
137
135
138
136
// Add or update
0 commit comments