Lack of interest Help page callback class extension

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.

Painbaker

Well-known member
Currently help page callback classes cannot be extended:

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
This suggestion has been closed. Votes are no longer accepted.
Being able to extend all kinds of callbacks like
  • BB Code Callbacks
  • Help Page Callbacks
  • Page Node Callbacks
  • Route Building Callbacks
  • Option Validation Callbacks
  • Option Display Callbacks
  • Cron Job Callbacks
would indeed be useful in some cases.

I think this this is less of an issue for user-defined callbacks (BB Code, Help Pages, Page Nodes, etc.) as the admin could at least change them if required, but is more problematic for Developer-defined callbacks (Routes, Options, Cronjobs, etc.)
 
Top Bottom