[TYPO3-core] RFC: Bug #6239: notifyStageChange() does not send emails, if groups are added to WS members/reviewers
Martin Kutschker
martin.kutschker-n0spam at no5pam-blackbox.net
Thu Feb 14 15:43:47 CET 2008
Andreas Wolf schrieb:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Hi Patrick,
>
> Patrick Rodacker schrieb:
>> Bugtracker references:
>> http://bugs.typo3.org/view.php?id=6239
>>
>> Branches:
>> TYPO3_4-1 & trunk
>> Problem:
>> The workspace allows to add backend users and backend groups as members
>> and reviewers, but email notification is only functional for added
>> backend users not the members (users) of an added backend group.
>>
>> Solution:
>> Extend the function notifyStageChange_getEmails() to handle not only
>> added backend users entries but also backend user groups correctly.
>
> I really like the feature, but I see one problem with the patch: A check
> of $users[0] with is_array() should be added in these two lines:
No, the problem (because it is confusing) is that $users is used for two
distinct data sets: an array of user IDs and a PREF match array.
This can be amened easily:
if (!$noTablePrefix) {
preg_match_all('/be_groups_([0-9]+)/', $listOfEntries, $match_groups);
preg_match_all('/be_users_([0-9]+)/', $listOfEntries, $match_users);
$groups = $match_groups[1];
$users = $match_users[1];
} else {
$groups = array();
$users = t3lib_BEfunc::trimExplode(',',$listOfEntries,1);
}
Test:
php -r
'preg_match_all("/be_users_([0-9]+)/","be_users_1,be_groups_5,be_users_2",$match);print_r($match);'
Now you have always an array (may be empty) for $users and $groups
always containing a list of IDs (without the table prefix).
Please change this as this will make the code much more readable.
Masi
More information about the TYPO3-team-core
mailing list