Skip to content

Commit

Permalink
fix(target_actor): tell the ID of missing actor
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 16, 2020
1 parent 6e05962 commit 81a6c01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inc/target_actor.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con
$user = new User;
$users_id = plugin_formcreator_getFromDBByField($user, 'name', $input['actor_value']);
if ($users_id === false) {
throw new ImportFailureException('failed to find a user');
throw new ImportFailureException(sprintf(__('failed to find a user: ID %1$d'), $users_id));
}
$input['actor_value'] = $users_id;
break;
Expand All @@ -145,7 +145,7 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con
$group = new Group;
$groups_id = plugin_formcreator_getFromDBByField($group, 'completename', $input['actor_value']);
if ($groups_id === false) {
throw new ImportFailureException('failed to find a group');
throw new ImportFailureException(sprintf(__('failed to find a group: ID %1$d'), $groups_id));
}
$input['actor_value'] = $groups_id;
break;
Expand All @@ -154,7 +154,7 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con
$supplier = new Supplier;
$suppliers_id = plugin_formcreator_getFromDBByField($supplier, 'name', $input['actor_value']);
if ($suppliers_id === false) {
throw new ImportFailureException('failed to find a supplier');
throw new ImportFailureException(sprintf(__('failed to find a supplier: ID %1$d'), $suppliers_id));
}
$input['actor_value'] = $suppliers_id;
break;
Expand Down

0 comments on commit 81a6c01

Please sign in to comment.