diff --git a/libraries/src/MVC/Model/AdminModel.php b/libraries/src/MVC/Model/AdminModel.php index e0bbf0980ce0f..a0e8f0a4495ef 100644 --- a/libraries/src/MVC/Model/AdminModel.php +++ b/libraries/src/MVC/Model/AdminModel.php @@ -1061,9 +1061,23 @@ public function publish(&$pks, $value = 1) return false; } + + // Prune items that are already at the given state + if ($table->get($table->getColumnAlias('published'), $value) == $value) + { + unset($pks[$i]); + + continue; + } } } + // Check if there are items to change + if (!count($pks)) + { + return true; + } + // Attempt to change the state of the records. if (!$table->publish($pks, $value, $user->get('id'))) {