Painbaker
Well-known member
Currently help page callback classes cannot be extended:
XF\Pub\Controller\Help
What I was expected to see:
XF\Pub\Controller\Help
PHP:
protected function handleHelpPage($pageName)
{
/** @var \XF\Entity\HelpPage $page */
$page = $this->finder('XF:HelpPage')
->where('page_name', $pageName)
->where('active', 1)
->whereAddOnActive()
->fetchOne();
if (!$page)
{
return $this->error(\XF::phrase('requested_page_not_found'), 404);
}
$this->assertCanonicalUrl($this->buildLink('help', $page));
$viewParams = [
'page' => $page,
'templateName' => 'public:_help_page_' . $page->page_id
];
$view = $this->view('XF:Help\Page', 'help_page', $viewParams);
if ($page->hasCallback())
{
call_user_func_array([$page->callback_class, $page->callback_method], [$this, &$view]);
}
return $this->addWrapperParams($view, $pageName);
}
What I was expected to see:
PHP:
if ($page->hasCallback())
{
$class = $this->app->extendClass($page->callback_class);
call_user_func_array([$class, $page->callback_method], [$this, &$view]);
}
Upvote
2