類別樹我使用tt_news
擴展與我TYPO3 v7.6.18(從31年2月6日剛剛升級) 和我在同類別樹的問題。我做多一點的調試爲tt_news
類別渲染和這個問題至今:無法生成TYPO3 tt_news新聞條目
老tca.php
看起來是這樣的:
'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'] ? 1 : 0, 'maxitems' => 500, 'MM' => 'tt_news_cat_mm', ), ),
而這給了我錯誤的結果,這意味着,我不明白一棵樹,但一個多選。現在,當我改變類型用戶,我得到這個錯誤:
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.php on line 167
我檢查了線tx_ttnews_TCAform_selectTree
類方法renderCategoryFieldsand
,它看起來像這樣:
$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中被調用,如tx_ttnews_TCAform_selectTree->renderCategoryFields
我不能改變類,它正在使用。
任何想法如何解決這個問題?
此外,您可以簡單地將'tt_news'更新爲最新版本,因爲它聲稱與TYPO3 7.x兼容。 –
我已經試過了。它產生'#1288215890:TCA樹配置無效:「treeConfig」數組缺失「錯誤。當我添加''treeConfig'=>數組( 'expandAll'=> true, 'parentField'=>'pid', 'appearance'=> array( 'showHeader'=> TRUE, ),我得到了零類,或者如果我將'parentField'更改爲0,我得到了一個分支中的所有類別和一個巨大的混亂(因爲名稱重疊)。 – Peon
@DainisAbols你可以比較你的TCA和TCA表格[tt_news 7.6.3](https://github.com/rupertgermann/tt_news/blob/7.6.3/Configuration/TCA/tt_news.php#L339-L361)。可能通過在'treeConfig'部分添加''parentField'=>'parent_category'來解決問題。 –