Breaking: #78192 - Refactor click menu (context menu)¶
See forge#78192
Description¶
Due to the refactoring and unification of the click/context-menu handling in the TYPO3 Backend, a few breaking changes have been introduced.
Classes removed¶
\TYPO3\
CMS\ Backend\ Click Menu\ Click Menu \TYPO3\
CMS\ Backend\ Context Menu\ Context Menu Action \TYPO3\
CMS\ Backend\ Context Menu\ Context Menu Action Collection \TYPO3\
CMS\ Backend\ Context Menu\ Pagetree\ Context Menu Data Provider \TYPO3\
CMS\ Backend\ Context Menu\ Pagetree\ Extdirect\ Context Menu Configuration \TYPO3\
CMS\ Backend\ Controller\ Click Menu Controller \TYPO3\
(replaced by new hook implementation:CMS\ Impexp\ Clickmenu \TYPO3\
)CMS\ Impexp\ Hook\ Context Menu Modify Items Hook \TYPO3\
CMS\ Impexp\ Hook\ Context Menu Disable Items Hook \TYPO3\
CMS\ Version\ Click Menu\ Version Click Menu
ExtJS component removed¶
- The
TYPO3.
component defined in contextmenu.js has been removed.Components. Page Tree. Context Menu - The
context
property as well asMenu Provider enable
andContext Menu open
methods of theContext Menu TYPO3.
component have been removed.Components. Page Tree. Tree
Migration¶
Migrate your code to a requireJS module for custom click-menu actions.
ClickMenu requireJS component removed¶
The TYPO3/
requireJS component (ClickMenu.js) has been removed.
Migration¶
Use the new requireJS component: TYPO3/
.
Page TSConfig change¶
The pagetree context-menu configuration in Page TSConfig has been removed (except for the disable
part).
The list of available menu items is now provided by Item
e.g. \TYPO3\
.
The TSConfig options for disabling click-menu items has been streamlined.
Also some items names have changed (e.g. new_
is now called new
, db_
is now open
). Refer to the provider class for correct naming.
Migration¶
Migrate TSConfig from:
options.
to options.
options.
to options.
options.
to options.
options.
to options.
Hooks removed¶
The following two hooks have been removed:
$GLOBALS
['TBE_ MODULES_ EXT'] ['x MOD_ alt_ clickmenu'] ['extend CMclasses'] $GLOBALS
['TYPO3_ CONF_ VARS'] ['SC_ OPTIONS'] ['backend'] ['context Menu'] ['disable Items']
Migration¶
Use the new ItemsProvider API to add or modify click-menu items.
See existing usage of the API in the core \TYPO3\
or \TYPO3\
.
Legacy Tree¶
Support for drag & drop menu for LegacyTree.js of pages has been dropped.
Changed markup (data attributes) for click menu¶
data-
has been replaced with the optional attributelist Frame data-
attribute. Context is set to "tree" for click-menus triggered from trees.context - for files,
data-
now contains the real table name "sys_file" while before it contained the combined identifier e.g.table 1:/
.fileadmin/ file. jpg - the
data-
attribute now contains the combined identifier of the file (before it was empty). Thus theuid data-
attribute value is not always an int.uid
- for files,
- the class which triggers the context-menu has changed from
t3-
tojs- clickmenutrigger t3js-
contextmenutrigger
Migration¶
To trigger click-menus for files, use the correct class-attribute as well as the table and uid data attributes. Replace data-
with data-
, data-
can be removed (it's a default context now).
Impact¶
Instantiating the PHP class will result in a fatal PHP error. Accessing removed JavaScript properties will result in a JavaScript error.
Removed hooks will not influence the menu rendering process.
Affected Installations¶
Any installation using the removed PHP classes, JS components or hooks.
Migration¶
Adapt your code to the new click menu API.