[TYPO3-ttnews] Assign category from processDatamap hook

Tomiţă MILITARU tomita.militaru at gmail.com
Wed Feb 15 12:00:45 CET 2012


Hello,

I'm using TYPO3 4.6.4 with tt_news 3.1.0 and I have BE users with tt_news
categories assigned to them. I want to be able to assign by default to an
article the category assigned to a BE user, so I'm using the process data
map hook from TYPO3 hook. However, it doesn't seem to work, here is my code:

function processDatamap_postProcessFieldArray($status, $table, $id,
&$fieldArray, &$reference) {

        if($status == 'new' && $table == 'tt_news' &&
!$GLOBALS['BE_USER']->isAdmin()) {

            $reference->datamap['tt_news'][$id]['category'] =
$GLOBALS['BE_USER']->user['tt_news_categorymounts'] . ',';

        }

    }

Any ideas why or another method I could do it?

Thank you.

-- 
Engr. Tomiţă MILITARU
Certified TYPO3 Integrator
Tel. +40741064681


More information about the TYPO3-project-tt-news mailing list