diff --git a/administrator/components/com_workflow/src/Model/WorkflowModel.php b/administrator/components/com_workflow/src/Model/WorkflowModel.php index beb71976e59d2..dec07533ed127 100644 --- a/administrator/components/com_workflow/src/Model/WorkflowModel.php +++ b/administrator/components/com_workflow/src/Model/WorkflowModel.php @@ -297,7 +297,12 @@ public function setDefault($pk, $value = 1) if ($value) { // Unset other default item - if ($table->load(array('default' => '1'))) + if ($table->load( + [ + 'default' => '1', + 'extension' => $table->get('extension') + ] + )) { $table->default = 0; $table->modified = $date; diff --git a/administrator/components/com_workflow/src/Table/WorkflowTable.php b/administrator/components/com_workflow/src/Table/WorkflowTable.php index faedf915b6f12..a9f7267bb39b7 100644 --- a/administrator/components/com_workflow/src/Table/WorkflowTable.php +++ b/administrator/components/com_workflow/src/Table/WorkflowTable.php @@ -144,7 +144,7 @@ public function check() } else { - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true); $query @@ -192,7 +192,7 @@ public function store($updateNulls = true) { // Existing item $this->modified_by = $user->id; - $this->modified = $date->toSql(); + $this->modified = $date->toSql(); } else { @@ -219,10 +219,15 @@ public function store($updateNulls = true) $this->modified_by = $this->created_by; } - if ($this->default == '1') + if ((int) $this->default === 1) { // Verify that the default is unique for this workflow - if ($table->load(array('default' => '1'))) + if ($table->load( + [ + 'default' => '1', + 'extension' => $this->extension + ] + )) { $table->default = 0; $table->store();