Skip to content

Commit c7d3dd5

Browse files
committed
Fix re-ordering of fetured articles
1 parent 8451d07 commit c7d3dd5

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

administrator/components/com_content/src/Controller/FeaturedController.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,22 @@
1818
* Featured content controller class.
1919
*
2020
* @since 1.6
21-
*
22-
* @deprecated 6.0 will be removed in 8.0
23-
* Use \Joomla\Component\Content\Administrator\Controller\ArticlesController instead
24-
* For Quickicons use articles.getQuickiconFeatured()
2521
*/
2622
class FeaturedController extends ArticlesController
2723
{
24+
/**
25+
* Proxy for getModel.
26+
*
27+
* @param string $name The model name. Optional.
28+
* @param string $prefix The class prefix. Optional.
29+
* @param array $config The array of possible config values. Optional.
30+
*
31+
* @return \Joomla\CMS\MVC\Model\BaseDatabaseModel
32+
*
33+
* @since __DEPLOYMENT_VERSION__
34+
*/
35+
public function getModel($name = 'Feature', $prefix = 'Administrator', $config = ['ignore_request' => true])
36+
{
37+
return parent::getModel($name, $prefix, $config);
38+
}
2839
}

administrator/components/com_content/tmpl/articles/default.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
}
5353

5454
if ($saveOrder && !empty($this->items)) {
55-
$saveOrderingUrl = 'index.php?option=com_content&task=articles.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1';
55+
$controller = $featured === '1' ? 'featured' : 'articles';
56+
$saveOrderingUrl = 'index.php?option=com_content&task=' . $controller . '.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1';
5657
HTMLHelper::_('draggablelist.draggable');
5758
}
5859

@@ -192,7 +193,7 @@
192193
}
193194

194195
?>
195-
<tr class="row<?php echo $i % 2; ?>" data-draggable-group="<?php echo $item->catid; ?>"
196+
<tr class="row<?php echo $i % 2; ?>"<?php echo $featured === '1' ? '' : ' data-draggable-group="' . $item->catid; ?>
196197
<?php echo $dataTransitionsAttribute ?? '' ?>
197198
>
198199
<td class="text-center">

0 commit comments

Comments
 (0)