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

Jake B.

Well-known member
Currently actionIndex contains this:

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':
         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 :)