Bug #4395
Userregistration: mail cannot be sent
Status: | Resolved | Start date: | 2009-08-30 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Martin Helmich | % Done: | 100% |
|
Category: | User registration | |||
Target version: | 0.1.8 | Estimated time: | 0.10 hour | |
TYPO3 Version: |
Description
Since userfiels are used in the mm_forum extension no user gets a registration mail anymore.
This is because in mm_forum\pi2\class.tx_mmforum_pi2.php $this->data is $this->piVars['reg'] and the email value cannot be found within "reg" anymore.
If you still have the email field as a userfield you can find it in $this->piVars['userfields'];
To solve this issue you should add the following function
/** * Returns the uid of the first userfield which uses the email-database field * @return int the uid of the email userfiels, if no one found it returns 0 */ function getUserfieldEMailUID() { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( '*', 'tx_mmforum_userfields', 'deleted=0', '','sorting DESC' ); if($GLOBALS['TYPO3_DB']->sql_num_rows($res)>0) { while($arr = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { if (!(strpos($arr['config'], 'datasource = email') === FALSE)) { return intval($arr['uid']); } } } return 0; }
Replace
$this->data['email']
in function sendEmail() / t3lib_div::plainMailEncoded
with
$this->piVars['userfields'][$this->getUserfieldEMailUID()]
and you are done.
Associated revisions
Fixed bug 4395: Specified key was too long; max key length is 1000 bytes
Fixed #4395.
Fixed #4395.
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/mm_forum/trunk@24148 735d13b6-9817-0410-8766-e36946ffe9aa
History
#1 Updated by Hauke Hain almost 6 years ago
- Assigned To set to Martin Helmich
- % Done changed from 50 to 70
I changed the function to be used with any fe_users field:
Please use this function instead:
/** * Returns the uid of the first userfield which uses the given database field * @return int the uid of the found userfiels, if no one found it returns 0 */ function getUserfieldUID($fe_users_field) { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( '*', 'tx_mmforum_userfields', 'deleted=0', '','sorting DESC' ); if($GLOBALS['TYPO3_DB']->sql_num_rows($res)>0) { while($arr = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { if (!(strpos($arr['config'], 'datasource = ' . $fe_users_field) === FALSE)) { return intval($arr['uid']); } } } return 0; }
#2 Updated by Martin Helmich almost 6 years ago
- Status changed from New to Resolved
- % Done changed from 70 to 100
Applied in changeset r24148.
#3 Updated by Hauke Hain almost 6 years ago
Doesn't work.
$this->validationEmailReceipient returns NULL.