Quantcast
Viewing all articles
Browse latest Browse all 2258

Joomla! 4.x Coding • Re: Manually sorting articles - ordering field

So I figured out rebuild has nothing to do with it and my efforts to reverse engineer had led me down the wrong path.

I figured out that the Ajax functions which I thought were not working, were in fact doing something.

saveOrderAjax in AdminController leads to AdminModel saveorder().

AdminModel saveorder() successfully reorders the articles (and the records in my custom component), but then, after properly updating the ordering column, AdminModel saveorder() executes the following:

Code:

// Execute reorder for each category.foreach ($conditions as $cond) {    $this->table->load($cond[0]);    $this->table->reorder($cond[1]);}
Table->reorder puts everything back the way it was. I did an override of the saveorder method and commented out that code and it works fine. I'm not using categories on the table for which I wanted to implement reordering, but com_content uses categories, and when this code executes, you can see that $cond[1][1] ends up being `catid`=2 (uncategorized) so it is supposed to be doing something, but right now it just undoes the reordering.

Statistics: Posted by neo314 — Thu Feb 08, 2024 4:49 am



Viewing all articles
Browse latest Browse all 2258

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>