Skip to content

EXT:formhandler – Use uid of last inserted id in email

28. May 2012

Task

Create an E-Mail with a link to the inserted record

Problem

According to the documentation this should work:

###value_saveDB|tablename|field###

And it works for “normal” db fields like “username”:

###value_saveDB|fe_users|username###

But it doesn’t work for “special” db fields like “uid”

###value_saveDB|fe_users|uid###

Cause

The function “process()” in /typo3conf/ext/formhandler/Classes/Finisher/Tx_Formhandler_Finisher_DB.php
Creates this array. The key “uid” is not set in $this->gp[‘saveDB’][‘feusers’].

$this->gp['saveDB'] => Array (

 [0] => Array (
           [table] =>feusers
           [uid] => 78
           [uidField] => uid
           )
[feusers] => Array (
           [pid] => 615
           ...
           )

)

Solution

None/Rewrite of sourcecode of /typo3conf/ext/formhandler/Classes/Finisher/Tx_Formhandler_Finisher_DB.php::process()

Workaround

Use “0” (zero) instead of Tablename “feusers”
###value_saveDB|0|uid###

Advertisements

From → EXT:formhandler

Leave a Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: