diff --git a/administrator/components/com_content/src/Model/ArticleModel.php b/administrator/components/com_content/src/Model/ArticleModel.php index 42e0cc2117c89..1b0142c7a5c04 100644 --- a/administrator/components/com_content/src/Model/ArticleModel.php +++ b/administrator/components/com_content/src/Model/ArticleModel.php @@ -1025,12 +1025,15 @@ public function save($data) { if (isset($data['featured'])) { - $this->featured( + if (!$this->featured( $this->getState($this->getName() . '.id'), $data['featured'], $data['featured_up'] ?? null, $data['featured_down'] ?? null - ); + )) + { + return false; + } } // Let's check if we have workflow association (perhaps something went wrong before) @@ -1098,6 +1101,17 @@ public function featured($pks, $value = 0, $featuredUp = null, $featuredDown = n $pks = ArrayHelper::toInteger($pks); $value = (int) $value; + // Convert empty strings to null for the query. + if ($featuredUp === '') + { + $featuredUp = null; + } + + if ($featuredDown === '') + { + $featuredDown = null; + } + if (empty($pks)) { $this->setError(Text::_('COM_CONTENT_NO_ITEM_SELECTED'));