Lack of interest Split out \XF\Pub\Controller\Forum::actionIndex into separate functions

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

Jake B.

Well-known member
Currently actionIndex contains this:

Code:
public function actionIndex(ParameterBag $params)
{
   if ($params->node_id || $params->node_name)
   {
      return $this->rerouteController('XF:Forum', 'Forum', $params);
   }

   if ($this->responseType == 'rss')
   {
      return $this->getForumRss();
   }

   switch ($this->options()->forumsDefaultPage)
   {
      case 'new_posts':
         return $this->rerouteController(__CLASS__, 'newposts');

      case 'forums':
      default:
         return $this->rerouteController(__CLASS__, 'list');
   }
}

So if you're adding another option for the forumsDefaultPage you have to duplicate the checks at the top before you can check for your own forumsDefaultPageOption and then returning the parent response, but if this portion was split into its own function you'd just extend that one function add in your check and then return the parent if your check isn't matched. Obviously not a huge deal, just a small quality of life improvement :)
 
Upvote 1
This suggestion has been closed. Votes are no longer accepted.
Top Bottom