[TYPO3-dev] Hook proposal for alt_doc.php
Bernhard Kraft
kraftb at kraftb.at
Sat Jul 8 00:35:06 CEST 2006
David Bruehlmeier wrote:
> Hi,
>
> I would like to propose a hook for alt_doc.php, in the function
> processData() right before $this->data is passed to TCE main.
>
> With this hook it is possible to change the instance of alt_doc.php
> _before_ the data is passed to TCE-main. This can be useful e.g. if an
> extension wants to unset certain records before they are processed by
> TCE-main, where it is not possible to stop TYPO3 from saving to the
> database.
Well ... it is possible :)
Use this hook in t3lib_tcemain for process_datamap:
$hookObj->processDatamap_preProcessFieldArray($incomingFieldArray, $table, $id, $this);
If you define your hook-method (processDatamap_preProcessFieldArray) like following:
function processDatamap_preProcessFieldArray($incoming, $table, &$id, $parentObj) {
you will be able to set $id to 0 (because & is used it is a variable passed by reference)
when $id get's set to 0 this record won't get processed further (the initial processing before this
hook isn't doing something tragical until the above hook get's executed) ...
> Please refer to the diff attached to bug 3812:
> http://bugs.typo3.org/view.php?id=3812
If you agree I will set the bug to "resolved"
greets,
Bernhard
--
----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
----------------------------------------------------------------------
[[ http://think-open.at | Open source company ]]
More information about the TYPO3-dev
mailing list