扩展新闻模型不适用于 FE 和news_ttnewsimport



为了升级现有系统,我必须将扩展tt_news记录导入tx_news。问题是,tx_news模型的扩展似乎不能正常工作,当然,导入也不是。

但是在后端,我可以在我的附加字段中查看和存储数据。

到目前为止我做了什么:

我已经扩展了tx_news版本 3.2.8我的模型:

class News extends GeorgRingerNewsDomainModelNews {
/**
 * uidForeign.
 *
 * @var int
 */
 protected $uidForeign;

/**
 * Sets the uidForeign.
 *
 * @param int $uidForeign
 *
 * @return void
 */
public function setUidForeign($uidForeign)
{
    $this->uidForeign = $uidForeign;
}
/**
 * Returns the uidForeign.
 *
 * @return int $uidForeign
*/
public function getUidForeign()
{
    return $this->uidForeign;
}

/**
 * tableForeign.
 *
 * @var string
 */
 protected $tableForeign;

/**
 * Sets the tableForeign.
 *
 * @param string $tableForeign
 *
 * @return void
 */
public function setTableForeign($tableForeign)
{
    $this->tableForeign = $tableForeign;
}
/**
 * Returns the tableForeign.
 *
 * @return string $tableForeign
*/
public function getTableForeign()
{
    return $this->tableForeign;
}
}

ext_localconf:

$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['classes']['Domain/Model/News'][] = 'news_extend';

我认为这应该行得通。typo3temp 中生成的类似乎是正确的。我的领域,包括他们的吸气手/二传手都在那里。

但是在控制器和 FE 中,我无法访问这些字段。

我错过了什么?我还能检查什么?

如果你升级一个项目,我不知道你使用旧版本的EXT:news的原因。

可能缺少的是该字段的 TCA 定义。

如果您想从tt_news迁移到新闻,可以在此处找到现成的解决方案 https://github.com/ext-news/news_ttnewsimport

原因是后端缓存的配置设置。他们将蜜蜂设置为

TYPO3\CMS\Core\Cache\Backend\NullBackend:class,而不是TYPO3\CMS\Core\Cache\Backend\NullBackend。

现在它起作用了。

最新更新