Looking much better @RisteD well done.
I would now make one simple change. Rough example:
This way if the reply object is not valid you can essentially return early and not do all of that work and run queries.
It's a micro optimisation but worth doing rather than running queries that can't be used.
I would now make one simple change. Rough example:
PHP:
public function actionIndex(ParameterBag $params)
{
$view = parent::actionIndex($params);
if(!($view instanceof \XF\Mvc\Reply\View)){
return $view;
}
// now do all your stuff
return $view;
}
This way if the reply object is not valid you can essentially return early and not do all of that work and run queries.
It's a micro optimisation but worth doing rather than running queries that can't be used.