0
votes

In order to upgrade an existing system, I have to import extended tt_news records to tx_news. The problem is, that the extending of the tx_news Model seems not to work proper and of course this, the import neither.

But in Backend I can see and store data in my additional fields.

What I've done so far:

I've extended tx_news Version 3.2.8 My Model:

class News extends \GeorgRinger\News\Domain\Model\News {

/**
 * 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';

I think that should work. The generated class in typo3temp seems correct. My fields including their getter/setter are in there.

But in Controller and FE I can not access these fields.

What am I missing? What else can I check?

2

2 Answers

1
votes

If you upgrade a project, I don't know really the reason why you are using an old version of EXT:news.

What could be missing is the TCA definition of the field.

If you want to migrate from tt_news to news, there is a ready-to-use solution which can be found here https://github.com/ext-news/news_ttnewsimport

0
votes

The reason was an configuration setting for the backend cache. they have bees set to TYPO3\CMS\Core\Cache\Backend\NullBackend:class instead TYPO3\CMS\Core\Cache\Backend\NullBackend.

Now it works.