Skip to content

Commit

Permalink
fix(form): import of forms in non existing entity
Browse files Browse the repository at this point in the history
when a form is being imported, does not exists and its entity does not exists, the form should not be created in root entity

Signed-off-by: Thierry Bugier <[email protected]>
  • Loading branch information
btry committed Jun 12, 2019
1 parent 7c85532 commit 8446e47
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,14 @@ public static function import(PluginFormcreatorImportLinker $importLinker, $form
WARNING
);
return false;
} else {
// The form is in an entity which does not exists yet
Session::addMessageAfterRedirect(
sprintf(__('The entity %1$s is required for the form %2$s.', 'formcreator'), $form['_entity'], $form['name']),
false,
WARNING
);
return false;
}
}
}
Expand Down

0 comments on commit 8446e47

Please sign in to comment.