Issue Bug Closed

#82861linkPopup option 'allowedExtensions' in TCA inputLink field not considered

Tobias Klepp 10/26/17, 18:11 updated 10/02/18, 10:56

Description

I setup the following TCA configuration:

        'link' => [
            'exclude' => 1,
            'label' => 'link',
            'config' => [
                'type' => 'input',
                'renderType' => 'inputLink',
                'size' => '50',
                'eval' => 'trim',
                'fieldControl' => [
                    'linkPopup' => [
                        'options' => [
                            'blindLinkOptions' => 'mail,page,spec,url,folder',
                            'blindLinkFields' => 'class,params,target,title',
                            'allowedExtensions' => 'html',
                        ],
                    ],
                ],
            ],
        ],

The allowedExtensions option has no effect in the Link browser popup. After some debugging, I found out, that the allowedExtensions parameter from the url is not available in $this->linkBrowser->getUrlParameters().

The effect is, that in FileLinkHandler.php on line 133 the allowed extensions are not present.

            if ($selectedFolder->checkActionPermission('read')) {
                $this->view->assign('selectedFolder', $selectedFolder);
                $parameters = $this->linkBrowser->getUrlParameters();
                $allowedExtensions = isset($parameters['allowedExtensions']) ? $parameters['allowedExtensions'] : '';
                $this->expandFolder($selectedFolder, $allowedExtensions);
            }

Reviews 2