diff --git a/administrator/components/com_workflow/src/Model/TransitionModel.php b/administrator/components/com_workflow/src/Model/TransitionModel.php index 940c678ce15d8..d6a5d4bf1d018 100644 --- a/administrator/components/com_workflow/src/Model/TransitionModel.php +++ b/administrator/components/com_workflow/src/Model/TransitionModel.php @@ -280,7 +280,8 @@ public function getForm($data = array(), $loadData = true) $form->setFieldAttribute($field, 'filter', 'unset'); } - $where = $this->getDbo()->quoteName('workflow_id') . ' = ' . (int) $data['workflow_id'] . ' AND ' . $this->getDbo()->quoteName('published') . ' = 1'; + $where = $this->getDbo()->quoteName('workflow_id') . ' = ' . (int) $data['workflow_id']; + $where .= ' AND ' . $this->getDbo()->quoteName('published') . ' = 1'; $form->setFieldAttribute('from_stage_id', 'sql_where', $where); $form->setFieldAttribute('to_stage_id', 'sql_where', $where); diff --git a/libraries/src/Workflow/WorkflowPluginTrait.php b/libraries/src/Workflow/WorkflowPluginTrait.php index b74f9fef5c686..1f763c1524c4f 100644 --- a/libraries/src/Workflow/WorkflowPluginTrait.php +++ b/libraries/src/Workflow/WorkflowPluginTrait.php @@ -11,6 +11,7 @@ \defined('JPATH_PLATFORM') or die; use Joomla\CMS\Form\Form; +use Joomla\CMS\Object\CMSObject; use ReflectionClass; /** @@ -18,12 +19,12 @@ * * @since 4.0.0 */ -trait WorkflowPluginTrait { - +trait WorkflowPluginTrait +{ /** * Add different parameter options to the transition view, we need when executing the transition * - * @param Form $form The form + * @param Form $form The form * @param \stdClass $data The data * * @return boolean @@ -52,25 +53,35 @@ protected function enhanceWorkflowTransitionForm(Form $form, $data) return $workflow; } - protected function getWorkflow(int $workflow_id = null) { - + /** + * Get the workflow for a given ID + * + * @param int|null $workflow_id ID of the workflow + * + * @return CMSObject|boolean Object on success, false on failure. + * + * @since __DEPLOY_VERSION__ + */ + protected function getWorkflow(int $workflow_id = null) + { $workflow_id = !empty($workflow_id) ? $workflow_id : $this->app->input->getInt('workflow_id'); - if (is_array($workflow_id)) { + if (is_array($workflow_id)) + { return false; } return $this->app->bootComponent('com_workflow') - ->getMVCFactory() - ->createModel('Workflow', 'Administrator', ['ignore_request' => true]) - ->getItem($workflow_id); + ->getMVCFactory() + ->createModel('Workflow', 'Administrator', ['ignore_request' => true]) + ->getItem($workflow_id); } - /** * Check if the current plugin should execute workflow related activities * - * @param string $context + * @param string $context Context to check + * * @return boolean * * @since 4.0.0 diff --git a/plugins/workflow/featuring/featuring.php b/plugins/workflow/featuring/featuring.php index 62551a3f027c8..69cbb0b3856ee 100644 --- a/plugins/workflow/featuring/featuring.php +++ b/plugins/workflow/featuring/featuring.php @@ -147,7 +147,12 @@ protected function enhanceItemForm(Form $form, $data) $form->setFieldAttribute($fieldname, 'type', 'spacer'); - $form->setFieldAttribute($fieldname, 'label', Text::sprintf('PLG_WORKFLOW_FEATURING_FEATURED', '' . htmlentities($text, ENT_COMPAT, 'UTF-8') . '')); + $label = '' . htmlentities($text, ENT_COMPAT, 'UTF-8') . ''; + $form->setFieldAttribute( + $fieldname, + 'label', + Text::sprintf('PLG_WORKFLOW_FEATURING_FEATURED', $label) + ); return true; }