Issue Bug Closed

#97738Exception for custom linkhandler tab in link browser

Sebastian Dudda 06/07/22, 10:07 updated 11/10/23, 19:41

Description

I am trying to add a custom LinkHandler to the Linkbrowser in the TYPO3 Backend (v11.5.10). The new Tab is displayed, but a click on it results in an “InvalidTemplateResourceException”.

To reproduce, I setup a blank TYPO3 v11.5.10 environment and installed the “t3docs/examples” extension. It behaves the same.
If you click the “Github Issue” link the same Exception is thrown:

"(1/1) #1257246929 TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException
Tried resolving a template file for controller action "Standard->linkBrowser" in format ".html", but none of the paths contained the expected template file (Standard/LinkBrowser.html). The following paths were checked: /var/www/html/public/typo3/sysext/recordlist/Resources/Private/Templates/LinkBrowser/"

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 4

  1. Andreas Kienast changed Sprint Focus On Location Sprint 08/05/22, 09:35

  2. Oliver Hader changed Sprint Focus On Location Sprint 11/03/22, 09:04

  3. Andreas Kienast commented and changed status New Needs Feedback 04/05/23, 14:08

    The example in the “examples” extension is broken. This is what needs to be done:

    • The custom link handler should extend `TYPO3\CMS\Recordlist\LinkHandler\AbstractLinkHandler`
    • The `initialize()` should be a bare minimum:
    public function initialize(AbstractLinkBrowserController $linkBrowser, $identifier, array $configuration)
    {
        parent::initialize($linkBrowser, $identifier, $configuration);
        $this->configuration = $configuration;
    }

    Finally, the `render()` method should configure the template path:

    public function render(ServerRequestInterface $request): string
    {
        // [...]
    
        $this->view->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:examples/Resources/Private/Templates/LinkBrowser')]);
        // [...]
        return $this->view->render('GitHub');
    }
  4. Benni Mack commented and changed status Needs Feedback Closed 11/10/23, 19:41

    Closing this issue, as this is a documentation topic, and nothing we will change in our code for v11 anymore. Sebastian, let me know if I’m wrong and I will re-open the ticket.