@@ -191,8 +191,11 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con
191
191
$ input ['actor_value ' ] = $ question ->getID ();
192
192
break ;
193
193
194
- case self ::ACTOR_TYPE_PERSON :
195
194
case self ::ACTOR_TYPE_AUTHORS_SUPERVISOR :
195
+ $ input ['actor_value ' ] = 0 ;
196
+ break ;
197
+
198
+ case self ::ACTOR_TYPE_PERSON :
196
199
$ user = new User ;
197
200
$ field = $ idKey == 'id ' ? 'id ' : 'name ' ;
198
201
$ users_id = plugin_formcreator_getFromDBByField ($ user , $ field , $ input ['actor_value ' ]);
@@ -278,12 +281,21 @@ public function export(bool $remove_uuid = false) : array {
278
281
case self ::ACTOR_TYPE_GROUP_FROM_OBJECT :
279
282
case self ::ACTOR_TYPE_TECH_GROUP_FROM_OBJECT :
280
283
$ question = new PluginFormcreatorQuestion ;
281
- if ($ question ->getFromDB ($ target_actor ['actor_value ' ])) {
282
- $ target_actor ['actor_value ' ] = $ question ->fields ['uuid ' ];
284
+ $ field = $ idToRemove == 'uuid ' ? 'id ' : 'uuid ' ;
285
+ $ question ->getFromDBByCrit ([
286
+ $ field => $ target_actor ['actor_value ' ]
287
+ ]);
288
+ if (!$ question ->isNewItem ()) {
289
+ $ target_actor ['actor_value ' ] = $ idToRemove == 'uuid ' ? $ question ->getID () : $ question ->fields ['uuid ' ];
283
290
}
291
+ // if ($question->getFromDB($target_actor['actor_value'])) {
292
+ // $target_actor['actor_value'] = $question->fields['uuid'];
293
+ // }
284
294
break ;
285
- case self ::ACTOR_TYPE_PERSON :
286
295
case self ::ACTOR_TYPE_AUTHORS_SUPERVISOR :
296
+ $ target_actor ['actor_value ' ] = 0 ;
297
+ break ;
298
+ case self ::ACTOR_TYPE_PERSON :
287
299
$ user = new User ;
288
300
$ field = $ idToRemove == 'uuid ' ? 'id ' : 'completename ' ;
289
301
if ($ user ->getFromDB ($ target_actor ['actor_value ' ])) {
0 commit comments