Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions administrator/components/com_content/models/article.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected function prepareTable($table)
// Reorder the articles within the category so the new article is first
if (empty($table->id))
{
$table->ordering = $table->getNextOrder('catid = ' . (int) $table->catid . ' AND state >= 0');
$table->reorder('catid = ' . (int) $table->catid . ' AND state >= 0');
}
}

Expand Down Expand Up @@ -672,12 +672,10 @@ public function featured($pks, $value = 0)

// Featuring.
$tuples = array();
$ordering = $table->getNextOrder();

foreach ($new_featured as $pk)
{
$tuples[] = $pk . ', ' . $ordering;
$ordering++;
$tuples[] = $pk . ', 0';
}

if (count($tuples))
Expand All @@ -700,6 +698,8 @@ public function featured($pks, $value = 0)
return false;
}

$table->reorder();

$this->cleanCache();

return true;
Expand Down