[BUGFIX] Fix link to edit file metadata in full window 25/49225/2
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 24 Jun 2016 09:48:29 +0000 (11:48 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 27 Jul 2016 08:26:06 +0000 (10:26 +0200)
When opening a window with a file reference in a full window
it is not possible to click the edit metadata button.

Use a normal href to avoid the issue with choosing the correct frame.

Resolves: #76729
Releases: master,7.6
Change-Id: Iaa140f28104782870c50ef0d876e472067a09fed
Reviewed-on: https://review.typo3.org/49225
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php

index bffa131..c6e503f 100644 (file)
@@ -471,17 +471,12 @@ class InlineRecordContainer extends AbstractContainer
                 );
                 if ($backendUser->check('tables_modify', 'sys_file_metadata')) {
                     $url = BackendUtility::getModuleUrl('record_edit', array(
-                        'edit[sys_file_metadata][' . (int)$recordInDatabase['uid'] . ']' => 'edit'
+                        'edit[sys_file_metadata][' . (int)$recordInDatabase['uid'] . ']' => 'edit',
+                        'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                     ));
-                    $editOnClick = 'if (top.content.list_frame) {' .
-                        'top.content.list_frame.location.href=' .
-                        GeneralUtility::quoteJSvalue($url . '&returnUrl=') .
-                        '+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search)' .
-                        ';' .
-                    '}';
                     $title = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.editMetadata');
                     $cells['editmetadata'] = '
-                                               <a class="btn btn-default" href="#" class="btn" onclick="' . htmlspecialchars($editOnClick) . '" title="' . htmlspecialchars($title) . '">
+                                               <a class="btn btn-default" href="' . htmlspecialchars($url) . '" title="' . htmlspecialchars($title) . '">
                                                        ' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '
                                                </a>';
                 }