Review 10.4 Abandoned

65052[TASK] Avoid inline JavaScript generated by BackendUtility:viewOnClick

Oliver Hader CR 0 V 0 Expert +833 −194 updated 12/03/20, 19:19

Commit message

Inline JavaScript produced by BackendUtility:viewOnClick is substituted
with markup based instructions and static JavaScript event handlers.

// basically delivers window.open(generatedUri)
BackendUtility::viewOnClick($pageId, $backPath, $rootLine, $section,
    $viewUri, $getVars, $switchFocus);

can be substituted with e.g.

\TYPO3\CMS\Backend\Routing\PreviewUriBuilder::create($pageId, $viewUri)
    ->withRootLine($rootLine)
    ->withSection($section)
    ->withAdditionalQueryParameters($getVars)
    ->serializeDispatcherAttributes([
        PreviewUriBuilder::OPTION_SWITCH_FOCUS => $switchFocus,
    ]);

which results in the following HTML data attributes
(data can be retrieved as array of complete element as well)

data-dispatch-action="TYPO3.WindowManager.localOpen"
data-dispatch-args="["https://...",null,"previewWin"]"

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 36

Show 16 more files