Unable to create TYPO3 tt_news category tree for news input


I am using the extension tt_newswith my TYPO3 v7.6.18 (just updated from 6.2.31) and I have problems with the category tree. I did a bit more debugging for rendering categories tt_news, and this is the problem so far:

the old one is tca.phpas follows:

'category' => Array (
    'exclude' => 1,
    'label' => 'LLL: EXT: tt_news / locallang_tca.xml: tt_news.category',
    'config' => Array (
        'type' => 'select',
        'form_type' => 'user',
        'userFunc' => 'tx_ttnews_TCAform_selectTree-> renderCategoryFields',
        'treeView' => 1,
        'foreign_table' => 'tt_news_cat',
        'autoSizeMax' => 50,
        'minitems' => $ confArr ['requireCategories']? 10,
        'maxitems' => 500,
        'MM' => 'tt_news_cat_mm',
    ),
),

And this gives me the wrong results, which means that I do not get the tree, but I select multi. Now, when I change the type to user, I get this error:

Fatal error: Call to undefined method TYPO3 \ CMS \ Backend \ Form \ Element \ UserElement :: addSelectOptionsToItemArray () in /home/portal/typo3project/typo3conf/ext/tt_news/lib/class.tx_ttnews_TCAform_selectTree. line16ree

I checked the line in the class tx_ttnews_TCAform_selectTreemethod renderCategoryFieldsandand looks like this:

$selItems = $fobj->addSelectOptionsToItemArray($fobj->initItemArray($this->PA['fieldConf']),$this->PA['fieldConf'],$fobj->setTSconfig($table,$row),$field);

$fobj : function renderCategoryFields(&$PA, &$fobj) , - , addSelectOptionsToItemArray FormEngine, UserElement.

tca like tx_ttnews_TCAform_selectTree->renderCategoryFields, , .

, ?

+4
1

TYPO3 7 , . renderType TCA select, selectTree.

, :

'category' => Array(
    'exclude' => 1,
    'label'   => 'LLL:EXT:tt_news/locallang_tca.xml:tt_news.category',
    'config'  => Array(
        'type'          => 'select',
        'renderType'    => 'selectTree',
        'foreign_table' => 'tt_news_cat',
        'autoSizeMax'   => 50,
        'minitems'      => $confArr['requireCategories'] ? 1 : 0,
        'maxitems'      => 500,
        'MM'            => 'tt_news_cat_mm',
        'treeConfig'    => array(
            'parentField' => 'parent_category',
        ),
    ),
),

, treeConfig .

+3

Source: https://habr.com/ru/post/1678104/


All Articles