Skip to content

Commit

Permalink
[!!!][TASK] Remove deprecated DatabaseRecordList CSV hooks (#4916)
Browse files Browse the repository at this point in the history
  • Loading branch information
linawolf authored Oct 29, 2024
1 parent 80bad33 commit 45c4514
Showing 1 changed file with 1 addition and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ BeforeRecordDownloadIsExecutedEvent
:php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList']['customizeCsvHeader']`
and
:php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList']['customizeCsvRow']`,
hooks, which have been deprecated with TYPO3 v13.2. See also
:ref:`BeforeRecordDownloadIsExecutedEvent-migration`.
hooks, which have been deprecated with TYPO3 v13.2.

The event :php:`TYPO3\CMS\Backend\RecordList\Event\BeforeRecordDownloadIsExecutedEvent`
can be used to modify the result of a download / export initiated via
Expand All @@ -38,50 +37,3 @@ API of BeforeRecordDownloadIsExecutedEvent
==========================================

.. include:: /CodeSnippets/Events/Backend/BeforeRecordDownloadIsExecutedEvent.rst.txt

.. _BeforeRecordDownloadIsExecutedEvent-migration:

Migration
=========

.. deprecated:: 13.2
The previously used hooks
:php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList']['customizeCsvHeader']`
and
:php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList']['customizeCsvRow']`,
used to manipulate the download / export configuration of records, triggered
in the :guilabel:`Web > List` backend module, have been deprecated in favor of a
new PSR-14 event :php:`TYPO3\CMS\Backend\RecordList\Event\BeforeRecordDownloadIsExecutedEvent`.

.. _BeforeRecordDownloadIsExecutedEvent-migration-customizeCsvHeader:

Migrating :php:`customizeCsvHeader`
-----------------------------------

The prior hook parameter/variable :php:`fields` is now available via
:php:`$event->getColumnsToRender()`. The actual record data
(previously :php:`$this->recordList`, submitted to the hook as its object
reference) is accessible via :php:`$event->getHeaderRow()`.

.. _BeforeRecordDownloadIsExecutedEvent-migration-customizeCsvRow:

Migrating :php:`customizeCsvRow`
--------------------------------

The following prior hook parameters/variables have these substitutes:

:php:`databaseRow`
is now available via :php:`$event->getRecords()` (see note below).
:php:`tableName`
is now available via :php:`$event->getTable()`.
:php:`pageId`
is now available via :php:`$event->getId()`.

The actual record data
(previously :php:`$this->recordList`, submitted to the hook as its object
reference) is accessible via :php:`$event->getRecords()`.

Please note that the hook was previously executed once per row retrieved
from the database. The PSR-14 event however - due to performance reasons -
is only executed for the full record list after database retrieval,
thus allows post-processing on this whole dataset.

0 comments on commit 45c4514

Please sign in to comment.