One of my CMSMS v.0.13 sites has approximately 1200 news articles split into multiple categories (organized by month).
When I attempted to add an additional news article, I received an Internal Server Error 400 and was unable to edit any news items thereafter.
Recognizing that this particular 400 Error meant a timeout error, as a test, I used phpMyAdmin to edit the backend database and removed about 100 news items. I was then able to administer the news articles from the CMSMS Admin Panel. When I replaced the 100 news items I previously deleted, I received the same error when I attempted to administer the news articles from the CMSMS Admin panel.
The reason for this error is that by default, when you go to administer the news items, CMSMS attempts to display ALL the news articles. Since in my case I have over 1200 articles, the server timed out and gave me the 400 Error.
I implemented a quick fix to this by hacking the \modules\News\action.defaultadmin.php file. Specifically, I appended the SQL LIMIT directive to the end of line 103 (to cap 'All Articles' to the 100 most recent articles and avoid a timeout error).
Code: Select all
$query = "SELECT n.*, nc.long_name FROM ".cms_db_prefix()."module_news n LEFT OUTER JOIN ".cms_db_prefix()."module_news_categories nc ON n.news_category_id = nc.news_category_id ORDER by news_date DESC LIMIT 0, 100";However, ideally, what is required is a pagination routine to display the news articles in the admin section.
Daniel15 posted some excellent code in his post (http://forum.cmsmadesimple.org/index.php/topic,10188.0.html) for pagination of news articles on the front-end. Is there a way a similar routine can be adapted for pagination of news articles in the backend/admin area?
Thanks!
Gazoo

