[TYPO3] itemsProcFunc problem

Vincent Mans typo3.vincnet at gmail.com
Tue Aug 28 16:18:42 CEST 2007


Hi list,

Problem with itemsProcFunc. I work with 4.1.2.

It's about fetching data from a foreign table, and put it in select.

The problem is: the uid field remains in the items field. It doubles up:
first all uids, then all titles. So what I get is, for example:

5
6
hello
goodbye

The uid of 'hello' is '5'.

When I select an item, only the uid goes over to the selected field.

Of course I tried several options and solutions from across the net etc. but
unfortunately....

Related question, that I couldn't test because of this, and that's not well
documented I think: is the value passed from the foreign table to this
table, or is still the uid passed?


This is the part from the tca:

    "tx_vincnetextranewsfield_work_signature" => Array (
            "exclude" => 1,
            "label" =>
"LLL:EXT:vincnet_extranewsfield/locallang_db.php:tt_news.tx_vincnetextranewsfield_work_signature",
            "config" => Array (
                "foreign_table" => "tt_news_xsign",
                "foreign_table_where" => "AND tt_news_xsign.pid=37",
                //"dontRemapTablesOnCopy" => "tt_news_xsign",
                "size" => 9,
                "minitems" => 0,
                "maxitems" => 3,
                "itemsProcFunc" =>
"tx_ttnews_itemsProcFunc->user_signature",
                "allowNonIdValues" => 1,
                "wizards" => Array(

This is the method in the class tx_ttnews_itemsProcFunc:

function user_signature(&$params,&$pObj)    {
        $columns  = 'title';
        $table      = 'tt_news_xsign';
        $where = 'deleted=0 AND hidden=0';
        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($columns, $table,
$where);
             if (!$res) { // check for sql error
                   echo('<hr>[File:'.__FILE__.' Func:'.__FUNCTION__.'
Line:'.__LINE__.'] SQL Error:'.$GLOBALS['TYPO3_DB']->SELECTquery($columns,
$table, $where));
                   return FALSE;
             }
        while($row1 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){
            $params['items'][] = Array($row1['title']);

        }
}

Greetz,
Vincent


More information about the TYPO3-english mailing list