[TYPO3-dev] How to get the page id when creating a new record
Helmut Hummel
helmut.hummel at typo3.org
Wed Oct 29 11:54:41 CET 2014
Hi Jérôme.
On 29.10.14 10:13, Jérôme BLUM wrote:
> I want to make some operations when saving a new record in a sysfolder. So I created a TCEmain (DataHandler) hook called "processDatamap_preProcessFieldArray" in which I can modify the fields array. But I need to know the PID of the record (uid of my current SysFolder) to modify another database record.
>
> Since the record is not yet created, I cannot get its PID. It is set in $_GET but using that trick seems bad to me...
>
> Do you have any idea that could help me?
In this hook, the pid is correctly set in $incomingFieldArray, even for
new records, so you can safely access it with $incomingFieldArray['pid']
Kind regards,
Helmut
--
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 CMS Active Contributor, TYPO3 Security Team Member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-dev
mailing list