diff --git a/administrator/components/com_workflow/src/Controller/DisplayController.php b/administrator/components/com_workflow/src/Controller/DisplayController.php index 030e0aad3ccaf..308fe25b19fe1 100644 --- a/administrator/components/com_workflow/src/Controller/DisplayController.php +++ b/administrator/components/com_workflow/src/Controller/DisplayController.php @@ -70,7 +70,7 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null, // If extension is not set try to get it from input or throw an exception if (empty($this->extension)) { - $extension = $this->input->getCmd('extension'); + $extension = $this->input->getCmd('extension', ''); $parts = explode('.', $extension); diff --git a/administrator/components/com_workflow/src/Controller/StageController.php b/administrator/components/com_workflow/src/Controller/StageController.php index 4c191984b229e..ca821cfaa83ac 100644 --- a/administrator/components/com_workflow/src/Controller/StageController.php +++ b/administrator/components/com_workflow/src/Controller/StageController.php @@ -78,7 +78,7 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null, // If extension is not set try to get it from input or throw an exception if (empty($this->extension)) { - $extension = $this->input->getCmd('extension'); + $extension = $this->input->getCmd('extension', ''); $parts = explode('.', $extension); @@ -155,7 +155,6 @@ protected function allowEdit($data = [], $key = 'id') protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { $append = parent::getRedirectToItemAppend($recordId); - $append .= '&workflow_id=' . $this->workflowId . '&extension=' . $this->extension . ($this->section ? '.' . $this->section : ''); return $append; diff --git a/administrator/components/com_workflow/src/Controller/StagesController.php b/administrator/components/com_workflow/src/Controller/StagesController.php index ae86156575217..ccadc8715f423 100644 --- a/administrator/components/com_workflow/src/Controller/StagesController.php +++ b/administrator/components/com_workflow/src/Controller/StagesController.php @@ -88,7 +88,7 @@ public function __construct(array $config = [], ?MVCFactoryInterface $factory = // If extension is not set try to get it from input or throw an exception if (empty($this->extension)) { - $extension = $this->input->getCmd('extension'); + $extension = $this->input->getCmd('extension', ''); $parts = explode('.', $extension); diff --git a/administrator/components/com_workflow/src/Controller/TransitionController.php b/administrator/components/com_workflow/src/Controller/TransitionController.php index c63b65f741c18..176c714f0409e 100644 --- a/administrator/components/com_workflow/src/Controller/TransitionController.php +++ b/administrator/components/com_workflow/src/Controller/TransitionController.php @@ -78,7 +78,7 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null, // If extension is not set try to get it from input or throw an exception if (empty($this->extension)) { - $extension = $this->input->getCmd('extension'); + $extension = $this->input->getCmd('extension', ''); $parts = explode('.', $extension); @@ -157,7 +157,7 @@ protected function allowEdit($data = [], $key = 'id') protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { $append = parent::getRedirectToItemAppend($recordId); - $append .= '&workflow_id=' . $this->workflowId . '&extension=' . $this->extension; + $append .= '&workflow_id=' . $this->workflowId . '&extension=' . $this->extension . ($this->section ? '.' . $this->section : ''); return $append; } @@ -172,7 +172,7 @@ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') protected function getRedirectToListAppend() { $append = parent::getRedirectToListAppend(); - $append .= '&workflow_id=' . $this->workflowId . '&extension=' . $this->extension; + $append .= '&workflow_id=' . $this->workflowId . '&extension=' . $this->extension . ($this->section ? '.' . $this->section : ''); return $append; } diff --git a/administrator/components/com_workflow/src/Controller/TransitionsController.php b/administrator/components/com_workflow/src/Controller/TransitionsController.php index 823be6773f2aa..ac0eee84e2e52 100644 --- a/administrator/components/com_workflow/src/Controller/TransitionsController.php +++ b/administrator/components/com_workflow/src/Controller/TransitionsController.php @@ -85,7 +85,7 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null, // If extension is not set try to get it from input or throw an exception if (empty($this->extension)) { - $extension = $this->input->getCmd('extension'); + $extension = $this->input->getCmd('extension', ''); $parts = explode('.', $extension); diff --git a/administrator/components/com_workflow/src/Controller/WorkflowController.php b/administrator/components/com_workflow/src/Controller/WorkflowController.php index af0c52bfdfb12..be92f9f72d83e 100644 --- a/administrator/components/com_workflow/src/Controller/WorkflowController.php +++ b/administrator/components/com_workflow/src/Controller/WorkflowController.php @@ -62,7 +62,7 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null, // If extension is not set try to get it from input or throw an exception if (empty($this->extension)) { - $extension = $this->input->getCmd('extension'); + $extension = $this->input->getCmd('extension', ''); $parts = explode('.', $extension); diff --git a/administrator/components/com_workflow/src/Controller/WorkflowsController.php b/administrator/components/com_workflow/src/Controller/WorkflowsController.php index 3d4f59877b21f..11670c5c241ff 100644 --- a/administrator/components/com_workflow/src/Controller/WorkflowsController.php +++ b/administrator/components/com_workflow/src/Controller/WorkflowsController.php @@ -62,7 +62,7 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null, // If extension is not set try to get it from input or throw an exception if (empty($this->extension)) { - $extension = $this->input->getCmd('extension'); + $extension = $this->input->getCmd('extension', ''); $parts = explode('.', $extension); diff --git a/administrator/components/com_workflow/src/Dispatcher/Dispatcher.php b/administrator/components/com_workflow/src/Dispatcher/Dispatcher.php index 77acbe6da1a16..2425b61efecfc 100644 --- a/administrator/components/com_workflow/src/Dispatcher/Dispatcher.php +++ b/administrator/components/com_workflow/src/Dispatcher/Dispatcher.php @@ -35,7 +35,7 @@ protected function checkAccess() $view = $input->getCmd('view'); $layout = $input->getCmd('layout'); $task = $input->getCmd('task'); - $extension = $input->getCmd('extension'); + $extension = $input->getCmd('extension', ''); $parts = explode('.', $extension); $allowedTasks = [ diff --git a/administrator/components/com_workflow/src/Model/StageModel.php b/administrator/components/com_workflow/src/Model/StageModel.php index bda6664101ab6..429b8c95eb4d6 100644 --- a/administrator/components/com_workflow/src/Model/StageModel.php +++ b/administrator/components/com_workflow/src/Model/StageModel.php @@ -356,7 +356,7 @@ public function publish(&$pks, $value = 1) */ protected function preprocessForm(Form $form, $data, $group = 'content') { - $extension = Factory::getApplication()->getInput()->get('extension'); + $extension = Factory::getApplication()->getInput()->get('extension', ''); $parts = explode('.', $extension); diff --git a/administrator/components/com_workflow/src/Model/TransitionModel.php b/administrator/components/com_workflow/src/Model/TransitionModel.php index 448625d4dc658..d5c8d7bd8c211 100644 --- a/administrator/components/com_workflow/src/Model/TransitionModel.php +++ b/administrator/components/com_workflow/src/Model/TransitionModel.php @@ -316,7 +316,7 @@ public function getWorkflow() */ protected function preprocessForm(Form $form, $data, $group = 'content') { - $extension = Factory::getApplication()->getInput()->get('extension'); + $extension = Factory::getApplication()->getInput()->get('extension', ''); $parts = explode('.', $extension); diff --git a/administrator/components/com_workflow/src/Model/WorkflowModel.php b/administrator/components/com_workflow/src/Model/WorkflowModel.php index 9ca07c065f60f..1fbbaa8b27ac6 100644 --- a/administrator/components/com_workflow/src/Model/WorkflowModel.php +++ b/administrator/components/com_workflow/src/Model/WorkflowModel.php @@ -223,7 +223,7 @@ protected function loadFormData() */ protected function preprocessForm(Form $form, $data, $group = 'content') { - $extension = Factory::getApplication()->getInput()->get('extension'); + $extension = Factory::getApplication()->getInput()->get('extension', ''); $parts = explode('.', $extension); diff --git a/administrator/components/com_workflow/src/Table/TransitionTable.php b/administrator/components/com_workflow/src/Table/TransitionTable.php index 14045f382f0e4..6986da64729da 100644 --- a/administrator/components/com_workflow/src/Table/TransitionTable.php +++ b/administrator/components/com_workflow/src/Table/TransitionTable.php @@ -58,6 +58,27 @@ public function __construct(DatabaseInterface $db, ?DispatcherInterface $dispatc parent::__construct('#__workflow_transitions', 'id', $db, $dispatcher); } + /** + * Overloaded check function + * + * @return boolean True on success + * + * @see Table::check() + * @since 6.1.4 + */ + public function check(): bool + { + if (!parent::check()) { + return false; + } + + if (empty($this->options)) { + $this->options = '{}'; + } + + return true; + } + /** * Method to bind an associative array or object to the Table instance. * This method only binds properties that are publicly accessible and optionally diff --git a/administrator/components/com_workflow/tmpl/stage/edit.php b/administrator/components/com_workflow/tmpl/stage/edit.php index 83eae9b3757a6..1dcc5638e079d 100644 --- a/administrator/components/com_workflow/tmpl/stage/edit.php +++ b/administrator/components/com_workflow/tmpl/stage/edit.php @@ -40,7 +40,7 @@ - + item->id != 0) : ?>