diff --git a/administrator/components/com_content/Model/ArticleModel.php b/administrator/components/com_content/Model/ArticleModel.php index 666dab0e516a5..270fe231eb005 100644 --- a/administrator/components/com_content/Model/ArticleModel.php +++ b/administrator/components/com_content/Model/ArticleModel.php @@ -137,9 +137,6 @@ protected function batchCopy($value, $pks, $contexts) // Reset hits because we are making a copy $this->table->hits = 0; - // Unpublish because we are making a copy - $this->table->state = 0; - // New category ID $this->table->catid = $categoryId; @@ -429,12 +426,12 @@ protected function canEditState($record) protected function prepareTable($table) { // Set the publish date to now - if ($table->state == 1 && (int) $table->publish_up == 0) + if ($table->state == Workflow::CONDITION_PUBLISHED && (int) $table->publish_up == 0) { $table->publish_up = Factory::getDate()->toSql(); } - if ($table->state == 1 && intval($table->publish_down) == 0) + if ($table->state == Workflow::CONDITION_PUBLISHED && intval($table->publish_down) == 0) { $table->publish_down = $this->getDbo()->getNullDate(); } @@ -711,12 +708,6 @@ public function getForm($data = array(), $loadData = true) } } - // Remove show_associations field if associations is not enabled - if (!$assoc) - { - $form->removeField('show_associations', 'attribs'); - } - return $form; } @@ -960,7 +951,6 @@ public function save($data) } $data['state'] = (int) $stage->condition; - } // Automatic handling of alias for empty fields diff --git a/administrator/components/com_content/Service/HTML/Icon.php b/administrator/components/com_content/Service/HTML/Icon.php index 8cab786e51005..b1649ab078930 100644 --- a/administrator/components/com_content/Service/HTML/Icon.php +++ b/administrator/components/com_content/Service/HTML/Icon.php @@ -18,6 +18,7 @@ use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Workflow\Workflow; use Joomla\Component\Mailto\Site\Helper\MailtoHelper; use Joomla\Registry\Registry; @@ -146,7 +147,7 @@ public function edit($article, $params, $attribs = array(), $legacy = false) } // Ignore if the state is negative (trashed). - if ($article->state < 0) + if (!in_array($article->state, [Workflow::CONDITION_UNPUBLISHED, Workflow::CONDITION_PUBLISHED])) { return; } @@ -175,7 +176,7 @@ public function edit($article, $params, $attribs = array(), $legacy = false) $contentUrl = \ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language); $url = $contentUrl . '&task=article.edit&a_id=' . $article->id . '&return=' . base64_encode($uri); - if ($article->state == 0) + if ($article->state == Workflow::CONDITION_UNPUBLISHED) { $overlib = Text::_('JUNPUBLISHED'); } diff --git a/administrator/components/com_fields/Table/FieldTable.php b/administrator/components/com_fields/Table/FieldTable.php index d44f8db4e0f91..8e3ec9d0ec336 100644 --- a/administrator/components/com_fields/Table/FieldTable.php +++ b/administrator/components/com_fields/Table/FieldTable.php @@ -148,6 +148,11 @@ public function check() $this->created_time = $date->toSql(); } + if (!(int) $this->modified_time) + { + $this->modified_time = $date->toSql(); + } + if (empty($this->created_user_id)) { $this->created_user_id = $user->get('id'); diff --git a/administrator/components/com_finder/sql/install.mysql.sql b/administrator/components/com_finder/sql/install.mysql.sql index 792d43c162566..71e4f42ea8235 100644 --- a/administrator/components/com_finder/sql/install.mysql.sql +++ b/administrator/components/com_finder/sql/install.mysql.sql @@ -74,8 +74,8 @@ CREATE TABLE IF NOT EXISTS `#__finder_logging` ( `searchterm` VARCHAR(255) NOT NULL DEFAULT '', `md5sum` VARCHAR(32) NOT NULL DEFAULT '', `query` BLOB NOT NULL, - `hits` INT(11) NOT NULL DEFAULT '1', - `results` INT(11) NOT NULL DEFAULT '0', + `hits` INT(11) NOT NULL DEFAULT 1, + `results` INT(11) NOT NULL DEFAULT 0, UNIQUE INDEX `md5sum` (`md5sum`), INDEX `searchterm` (`searchterm`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; diff --git a/administrator/components/com_workflow/View/Stages/HtmlView.php b/administrator/components/com_workflow/View/Stages/HtmlView.php index 9ffd611a6e9a0..ecec43122ce99 100644 --- a/administrator/components/com_workflow/View/Stages/HtmlView.php +++ b/administrator/components/com_workflow/View/Stages/HtmlView.php @@ -171,10 +171,14 @@ protected function addToolbar() ToolbarHelper::addNew('stage.add'); } - if ($canDo->get('core.edit.state') && !$isCore) + if ($canDo->get('core.edit.state')) { - ToolbarHelper::publishList('stages.publish'); - ToolbarHelper::unpublishList('stages.unpublish'); + if (!$isCore) + { + ToolbarHelper::publishList('stages.publish'); + ToolbarHelper::unpublishList('stages.unpublish'); + } + ToolbarHelper::makeDefault('stages.setDefault', 'COM_WORKFLOW_TOOLBAR_DEFAULT'); } diff --git a/administrator/components/com_workflow/tmpl/stages/default.php b/administrator/components/com_workflow/tmpl/stages/default.php index 534ba078ce4d6..af2f577c7e588 100644 --- a/administrator/components/com_workflow/tmpl/stages/default.php +++ b/administrator/components/com_workflow/tmpl/stages/default.php @@ -89,10 +89,10 @@ stages as $i => $item): $edit = Route::_('index.php?option=com_workflow&task=stage.edit&id=' . $item->id . '&workflow_id=' . (int) $this->workflowID . '&extension=' . $this->extension); - $canEdit = $user->authorise('core.edit', $this->extension . '.stage.' . $item->id) && !$isCore; + $canEdit = $user->authorise('core.edit', $this->extension . '.stage.' . $item->id); // @TODO set proper checkin fields $canCheckin = true || $user->authorise('core.admin', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; - $canChange = $user->authorise('core.edit.stage', $this->extension . '.stage.' . $item->id) && $canCheckin && !$isCore; + $canChange = $user->authorise('core.edit.stage', $this->extension . '.stage.' . $item->id) && $canCheckin; ?>