From 82c9c8b9360c8b11f0d0957553df61f6d3afbe12 Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Fri, 2 Feb 2024 12:14:05 +0000 Subject: [PATCH] Refactor Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- src/MainMenuWidgets/LocationPicker.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/MainMenuWidgets/LocationPicker.php b/src/MainMenuWidgets/LocationPicker.php index 64d4cb7..f18eb86 100644 --- a/src/MainMenuWidgets/LocationPicker.php +++ b/src/MainMenuWidgets/LocationPicker.php @@ -55,6 +55,7 @@ public function onLoadForm() return $this->makePartial('formwidgets/recordeditor/form', [ 'formRecordId' => $recordId, + 'showDeleteButton' => $model->exists, 'formTitle' => lang($model->exists ? 'igniter.local::default.picker.text_edit_location' : 'igniter.local::default.picker.text_new_location'), 'formWidget' => $this->makeLocationFormWidget($model), ]); @@ -122,11 +123,11 @@ public function onDeleteRecord() new FlashException(lang('igniter.local::default.picker.alert_user_restricted')) ); - $model = $this->findFormModel(post('recordId')); + $model = $this->findFormModel((string)post('recordId')); $model->delete(); - flash()->success(sprintf(lang('igniter::admin.alert_success'), lang($this->formName).' deleted'))->now(); + flash()->success(sprintf(lang('igniter::admin.alert_success'), lang('igniter.local::default.picker.text_form_name').' deleted'))->now(); return $this->reload(); }