TYPO3 Extbase individual code on backend-deletion of an object

前端 未结 2 1752
春和景丽
春和景丽 2021-01-14 08:03

I would like to execute some individual code when one of my Extbase domain objects is deleted from the list view in TYPO3 backend.

Thought that it could / would work

2条回答
  •  臣服心动
    2021-01-14 08:39

    List view uses TCEmain hooks during its operations, so you can use one of them to intersect delete action, i.e.: processCmdmap_deleteAction

    1. Register your hooks class in typo3conf/ext/your_ext/ext_tables.php

      $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = 'VENDORNAME\\YourExt\\Hooks\\ProcessCmdmap';
      
    2. Create a class with valid namespace and path (according to previous step)
      file: typo3conf/ext/your_ext/Classes/Hooks/ProcessCmdmap.php

    3. Don't forget to clear system cache after registering new hook's class

提交回复
热议问题