Issue Bug Closed

#109266Fileadmin context menu (Cut, Copy) not working

Michal Podrouzek 03/16/26, 21:38 updated 04/21/26, 11:30

Description

In the context menu (right click on file) in fileadmin list view in clean instance of TYPO3 14 user cannot copy or cut content. I’ve compared it with the version 13 where it works fine.

In the ContextMenuController the $CB is retrieved, but since it is urlencoded, it does not work in the clipboard. I’ve managed to get it working with patching ContextMenuController::clipboardAction to decode the file before passing the $CB to clipboard.

public function clipboardAction(ServerRequestInterface $request): ResponseInterface
    {
        $clipboard = GeneralUtility::makeInstance(Clipboard::class);
        $clipboard->initializeClipboard($request);
        $clipboard->lockToNormal();

        $CB = array_replace_recursive($request->getQueryParams()['CB'] ?? [], $request->getParsedBody()['CB'] ?? []);
        // FIX: Decode the keys in the 'el' array
        if (isset($CB['el']) && is_array($CB['el'])) {
            $decodedEl = [];
            foreach ($CB['el'] as $key => $value) {
                $decodedEl[urldecode($key)] = $value;
            }
            $CB['el'] = $decodedEl;
        }
        $clipboard->setCmd($CB);
        $clipboard->cleanCurrent();

        $clipboard->endClipboard();
        return new JsonResponse([]);
    }

Reviews 1

Files 7

History 79

  1. Garvin Hicking commented and changed attached Screenshot 2026-03-19 at 09.09.22.png attached Screenshot 2026-03-19 at 09.09.39.png attached Screenshot 2026-03-19 at 09.09.45.png attached Screenshot 2026-03-19 at 09.09.49.png status New Needs Feedback <span data-processor="relativetime" data-value="2026-03-19T08:10:14+00:00" > 03/19/26, 08:10 </span>

    Hi!

    Hm, I cannot reproduce this in current v14 main (latest Chromium).

    Here are the screenshots of how I proceeded. Maybe I’m testing it wrong?

  2. Michal Podrouzek commented and changed attached Screenshot 2026-03-19 at 09.51.22.png <span data-processor="relativetime" data-value="2026-03-19T08:52:26+00:00" > 03/19/26, 08:52 </span>

    Garvin Hicking wrote in #note-1:
    > Hi!
    >
    > Hm, I cannot reproduce this in current v14 main (latest Chromium).
    >
    > Here are the screenshots of how I proceeded. Maybe I’m testing it wrong?

    Hi Garvin,

    you are going with the dots menu, that works fine, try it with right-clicking on the file icon

  3. Garvin Hicking commented and changed status Needs Feedback Accepted <span data-processor="relativetime" data-value="2026-03-19T09:15:33+00:00" > 03/19/26, 09:15 </span>

    Great, thanks – I can reproduce.

    Would you like to contribute your patch to our review system, so a possible solution could be attributed to you?

  4. Gerrit Code Review pushed patch set 1 for main to change 93275 status Accepted Under Review <span data-processor="relativetime" data-value="2026-03-19T12:38:15+00:00" > 03/19/26, 12:38 </span>

  5. Michal Podrouzek commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-04-14T20:20:11+00:00" > 04/14/26, 20:20 </span>

    Applied in changeset commit:613156391e43762db48b3d900ae5231f7434ceb4.