I created a new extension to add some fields to the news extension.
In the backend everything works fine, I can add values to the fields and they are correctly saved in the database.
When I clear the cache and rebuild PHP Autoload Information it show in the frontend but after some hours the new fields disappears magically.
I have created the extension with the Extension Builder and added the field manually.
I read the ProxyClass generator info a lot of times but cannot see the fail.
Looks like I need connect the class in the cache or elsewhere.
I’m really desperate with this.
ext:albr_news_new_fields/Classes/Domain/Model/News.php
namespace Albr\AlbrNewsNewFields\Domain\Model;
class News extends \GeorgRinger\News\Domain\Model\News {
/**
* titulo1
*
* @var string
*/
protected $titulo1 = '';
ext:albr_news_new_fields/ext_localconf.php
defined('TYPO3_MODE') or die();
$GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['classes']['Domain/Model/News'][] = 'albr_news_new_fields';
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class)
->registerImplementation(\GeorgRinger\News\Domain\Model\News::class,
\Albr\AlbrNewsNewFields\Domain\Model\News::class);
ext:albr_news_new_fields/ext_tables.php
call_user_func(
function()
{
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('albr_news_new_fields', 'Configuration/TypoScript', 'Nuevos campos tx_news');
}
);
$tempColumns = Array (
'titulo1' => [
'exclude' => true,
'label' => 'LLL:EXT:albr_news_new_fields/Resources/Private/Language/locallang_db.xlf:titulo1',
'description' => 'LLL:EXT:albr_news_new_fields/Resources/Private/Language/locallang_db.xlf:titulo1.description',
'config' => [
'type' => 'input',
'size' => 50,
'eval' => 'trim'
…
ext:albr_news_new_fields/Configuration/Typoscript/setup.typoscript
plugin.tx_news {
persistence {
classes {
GeorgRinger\News\Domain\Model\News {
subclasses {
# three different classes are used for each news type
# 0 == default news
0 = Albr\AlbrNewsNewFields\Domain\Model\News
}
}
Albr\AlbrNewsNewFields\Domain\Model\NewsDefault {
mapping {
recordType = 0
tableName = tx_news_domain_model_news
}
}
Albr\AlbrNewsNewFields\Domain\Model\News {
mapping {
recordType = 0
tableName = tx_news_domain_model_news
}
}
}
}
}
config.tx_extbase {
persistence {
classes {
GeorgRinger\News\Domain\Model\News {
subclasses {
GeorgRinger\News\Domain\Model\News = Albr\AlbrNewsNewFields\Domain\Model\News
}
}
Albr\AlbrNewsNewFields\Domain\Model\News {
mapping {
tableName = tx_news_domain_model_news
}
}
}
}
}
I'm using: TYPO3 9.5.22 & News 7.3.1