diff --git a/administrator/components/com_templates/src/Model/TemplateModel.php b/administrator/components/com_templates/src/Model/TemplateModel.php index c6f45b68c7a4d..1ca54667aadfe 100644 --- a/administrator/components/com_templates/src/Model/TemplateModel.php +++ b/administrator/components/com_templates/src/Model/TemplateModel.php @@ -1702,14 +1702,17 @@ public function getFont() $explodeArray = explode('/', $relPath); $fileName = end($explodeArray); $path = $this->getBasePath() . base64_decode($app->getInput()->get('file')); + $isModern = $template->xmldata->inheritable || !empty($template->xmldata->parent); if (stristr($client->path, 'administrator') === false) { - $folder = '/templates/'; + $folder = $isModern ? '/media/templates/site/' : '/templates/'; } else { - $folder = '/administrator/templates/'; + $folder = $isModern ? '/media/templates/administrator/' : '/administrator/templates/'; } - $uri = Uri::root(true) . $folder . $template->element; + $uri = $isModern + ? (str_replace('/administrator/', '/', Uri::root(true))) . $folder . $template->element + : Uri::root(true) . $folder . $template->element; if (file_exists(Path::clean($path))) { $font['address'] = $uri . $relPath; 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 b113d32619212..9b10299813577 100644 --- a/administrator/components/com_workflow/src/Controller/StageController.php +++ b/administrator/components/com_workflow/src/Controller/StageController.php @@ -77,7 +77,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); @@ -154,7 +154,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 bd5c25f62b935..8661fb3cabe66 100644 --- a/administrator/components/com_workflow/src/Controller/StagesController.php +++ b/administrator/components/com_workflow/src/Controller/StagesController.php @@ -87,7 +87,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 e78227550dab3..a7ebc2ad90fd9 100644 --- a/administrator/components/com_workflow/src/Controller/TransitionController.php +++ b/administrator/components/com_workflow/src/Controller/TransitionController.php @@ -77,7 +77,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); @@ -156,7 +156,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; } @@ -171,7 +171,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 5633363111185..418f68468407c 100644 --- a/administrator/components/com_workflow/src/Dispatcher/Dispatcher.php +++ b/administrator/components/com_workflow/src/Dispatcher/Dispatcher.php @@ -31,9 +31,8 @@ class Dispatcher extends ComponentDispatcher */ protected function checkAccess() { - $extension = $this->getApplication()->getInput()->getCmd('extension'); - - $parts = explode('.', $extension); + $extension = $this->getApplication()->getInput()->getCmd('extension', ''); + $parts = explode('.', $extension); // Check the user has permission to access this component if in the backend if ($this->app->isClient('administrator') && !$this->app->getIdentity()->authorise('core.manage.workflow', $parts[0])) { 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..6e76116b93e19 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 __DEPLOY_VERSION__ + */ + public function check(): bool + { + $return = parent::check(); + + if ($return) { + if (empty($this->options)) { + $this->options = '{}'; + } + } + + return $return; + } + /** * 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) : ?>