fix: [genericTemplates] delete template can be invoked without an ID
parent
3af0b0afc5
commit
9245b2d720
|
@ -18,7 +18,11 @@ $form = $this->element('genericElements/Form/genericForm', [
|
|||
]);
|
||||
$formHTML = sprintf('<div class="d-none">%s</div>', $form);
|
||||
|
||||
$bodyMessage = !empty($deletionText) ? __($deletionText) : __('Are you sure you want to delete {0} #{1}?', h(Cake\Utility\Inflector::singularize($this->request->getParam('controller'))), h($id));
|
||||
if (!empty($id)) {
|
||||
$bodyMessage = !empty($deletionText) ? __($deletionText) : __('Are you sure you want to delete {0} #{1}?', h(Cake\Utility\Inflector::singularize($this->request->getParam('controller'))), h($id));
|
||||
} else {
|
||||
$bodyMessage = !empty($deletionText) ? __($deletionText) : __('Are you sure you want to delete the given {0}?', h(Cake\Utility\Inflector::singularize($this->request->getParam('controller'))));
|
||||
}
|
||||
$bodyHTML = sprintf('%s%s', $formHTML, $bodyMessage);
|
||||
|
||||
echo $this->Bootstrap->modal([
|
||||
|
|
Loading…
Reference in New Issue