chg: [genericForm] Fallback entity to null (to model-less form) if not provided

pull/34/head
mokaddem 2020-11-25 16:45:55 +01:00
parent 7f067acfa2
commit 465b257d6e
2 changed files with 2 additions and 2 deletions

View File

@ -13,8 +13,7 @@
'submit' => [
'action' => $this->request->getParam('action')
],
],
'entity' => null,
]
]);
?>
</div>

View File

@ -15,6 +15,7 @@
$modelForForm = empty($data['model']) ?
h(\Cake\Utility\Inflector::singularize(\Cake\Utility\Inflector::classify($this->request->getParam('controller')))) :
h($data['model']);
$entity = isset($entity) ? $entity : null;
$fieldsString = '';
$simpleFieldWhitelist = [
'default', 'type', 'placeholder', 'label', 'empty', 'rows', 'div', 'required'