当前位置: 首页 > 知识库问答 >
问题:

Typo3 9 | Extbase扩展:某些值未从后端tca字段保存到数据库

仉明知
2023-03-14

这是我的设置,通过这种行为减少到一个字段(“我的扩展”和“我的供应商”只是这里的占位符,而不是真正的代码。不想让我的客户名字出现在这里):

myExtension/ext_表。sql

#
# Table structure for table 'tx_myExtension_domain_model_kategorie'
#
CREATE TABLE tx_<myExtension>_domain_model_kategorie (
    dh_description text,
);

myExtension/Configuration/TCA/tx\u myExtension\u domain\u model\u kategorie。php

        'dh_description' => [
            'exclude' => true,
            'label' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_<myExtension>_domain_model_kategorie.dh_description',
            'config' => [
                'type' => 'text',
                'enableRichtext' => true,
                'richtextConfiguration' => 'minimal',
                'fieldControl' => [
                    'fullScreenRichtext' => [
                        'disabled' => false,
                    ],
                ],
                'cols' => 40,
                'rows' => 15,
                'eval' => 'trim',
            ],

        ],

myExtension/Classes/Domain/Model/Kategorie。php

namespace MyVendor\myExtension\Domain\Model;

class Kategorie extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
    /**
     * dhDescription
     *
     * @var string
     */
    protected $dhDescription = '';

    /**
     * Returns the dhDescription
     *
     * @return string $dhDescription
     */
    public function getDhDescription()
    {
        return $this->dhDescription;
    }

    /**
     * Sets the dhDescription
     *
     * @param string $dhDescription
     * @return void
     */
    public function setDhDescription($dhDescription)
    {
        $this->dhDescription = $dhDescription;
    }

我已经重新安装了扩展,清除了缓存,清除了typo3temp等等。看起来,这个模型没有任何效果。如果我重命名该文件或在其中写入语法错误,typo3就不麻烦了。

有什么想法吗?

如前所述,以下是完整的TCA:

<?php
return [
    'ctrl' => [
        'title' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_myExtension_domain_model_kategorie',
        'label' => 'kategoriename',
        'tstamp' => 'tstamp',
        'crdate' => 'crdate',
        'cruser_id' => 'cruser_id',
        'versioningWS' => true,
        'languageField' => 'sys_language_uid',
        'transOrigPointerField' => 'l10n_parent',
        'transOrigDiffSourceField' => 'l10n_diffsource',
        'delete' => 'deleted',
        'enablecolumns' => [
            'disabled' => 'hidden',
            'starttime' => 'starttime',
            'endtime' => 'endtime',
        ],
        'searchFields' => 'kategoriename,dh_description,dh_meta_keywords,dh_meta_description',
        'iconfile' => 'EXT:myExtension/Resources/Public/Icons/tx_myExtension_domain_model_kategorie.gif'
    ],
    'interface' => [
        'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, orig_id, kategoriename, ordnung, zeitstempel, in_teaser, dh_description, dh_meta_keywords, dh_meta_description, kurstypen',
    ],
    'types' => [
        '1' => ['showitem' => 'hidden, in_teaser, kategoriename, dh_description, ordnung, kurstypen,
        --div--;SEO Data, dh_meta_keywords, dh_meta_description,
        --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime,
        --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_db.xlf:tabs.seo, dh_description, dh_meta_keywords, dh_meta_description'],
    ],
    'columns' => [
        'sys_language_uid' => [
            'exclude' => true,
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectSingle',
                'special' => 'languages',
                'items' => [
                    [
                        'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages',
                        -1,
                        'flags-multiple'
                    ]
                ],
                'default' => 0,
            ],
        ],
        'l10n_parent' => [
            'displayCond' => 'FIELD:sys_language_uid:>:0',
            'exclude' => true,
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectSingle',
                'default' => 0,
                'items' => [
                    ['', 0],
                ],
                'foreign_table' => 'tx_myExtension_domain_model_kategorie',
                'foreign_table_where' => 'AND {#tx_myExtension_domain_model_kategorie}.{#pid}=###CURRENT_PID### AND {#tx_myExtension_domain_model_kategorie}.{#sys_language_uid} IN (-1,0)',
            ],
        ],
        'l10n_diffsource' => [
            'config' => [
                'type' => 'passthrough',
            ],
        ],
        't3ver_label' => [
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel',
            'config' => [
                'type' => 'input',
                'size' => 30,
                'max' => 255,
            ],
        ],
        'hidden' => [
            'exclude' => true,
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible',
            'config' => [
                'type' => 'check',
                'renderType' => 'checkboxToggle',
                'items' => [
                    [
                        0 => '',
                        1 => '',
                        'invertStateDisplay' => true
                    ]
                ],
            ],
        ],
        'starttime' => [
            'exclude' => true,
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
            'config' => [
                'type' => 'input',
                'renderType' => 'inputDateTime',
                'eval' => 'datetime,int',
                'default' => 0,
                'behaviour' => [
                    'allowLanguageSynchronization' => true
                ]
            ],
        ],
        'endtime' => [
            'exclude' => true,
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
            'config' => [
                'type' => 'input',
                'renderType' => 'inputDateTime',
                'eval' => 'datetime,int',
                'default' => 0,
                'range' => [
                    'upper' => mktime(0, 0, 0, 1, 1, 2038)
                ],
                'behaviour' => [
                    'allowLanguageSynchronization' => true
                ]
            ],
        ],

        'orig_id' => [
            'exclude' => true,
            'label' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_myExtension_domain_model_kategorie.orig_id',
            'config' => [
                'type' => 'input',
                'size' => 4,
                'eval' => 'int'
            ]
        ],
        'kategoriename' => [
            'exclude' => true,
            'label' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_myExtension_domain_model_kategorie.kategoriename',
            'config' => [
                'type' => 'input',
                'size' => 30,
                'eval' => 'trim'
            ],
        ],
        'ordnung' => [
            'exclude' => true,
            'label' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_myExtension_domain_model_kategorie.ordnung',
            'config' => [
                'type' => 'input',
                'size' => 4,
                'eval' => 'int'
            ]
        ],
        'zeitstempel' => [
            'exclude' => true,
            'label' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_myExtension_domain_model_kategorie.zeitstempel',
            'config' => [
                'type' => 'input',
                'renderType' => 'inputDateTime',
                'size' => 10,
                'eval' => 'datetime',
                'default' => time()
            ],
        ],
        'in_teaser' => [
            'exclude' => true,
            'label' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_myExtension_domain_model_kategorie.in_teaser',
            'config' => [
                'type' => 'check',
                'items' => [
                    '1' => [
                        '0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled'
                    ]
                ],
                'default' => 0,
            ]
        ],
        'dh_description' => [
            'exclude' => true,
            'label' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_myExtension_domain_model_kategorie.dh_description',
            'config' => [
                'type' => 'text',
                'enableRichtext' => true,
                'richtextConfiguration' => 'minimal',
                'fieldControl' => [
                    'fullScreenRichtext' => [
                        'disabled' => false,
                    ],
                ],
                'cols' => 40,
                'rows' => 15,
                'eval' => 'trim',
            ],

        ],
        'dh_meta_keywords' => [
            'exclude' => true,
            'label' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_myExtension_domain_model_kategorie.dh_meta_keywords',
            'config' => [
                'type' => 'text',
                'cols' => 40,
                'rows' => 15,
                'eval' => 'trim'
            ]
        ],
        'dh_meta_description' => [
            'exclude' => true,
            'label' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_myExtension_domain_model_kategorie.dh_meta_description',
            'config' => [
                'type' => 'text',
                'cols' => 40,
                'rows' => 15,
                'eval' => 'trim'
            ]
        ],
        'kurstypen' => [
            'exclude' => true,
            'label' => 'LLL:EXT:myExtension/Resources/Private/Language/locallang_db.xlf:tx_myExtension_domain_model_kategorie.kurstypen',
            'config' => [
                'type' => 'inline',
                'foreign_table' => 'tx_myExtension_domain_model_kurstypen',
                'foreign_field' => 'kategorie',
                'maxitems' => 9999,
                'appearance' => [
                    'collapseAll' => 1,
                    'levelLinksPosition' => 'top',
                    'showSynchronizationLink' => 1,
                    'showPossibleLocalizationRecords' => 1,
                    'showAllLocalizationLink' => 1
                ],
            ],

        ],

    ],
];

共有1个答案

章远航
2023-03-14

多亏了巴斯蒂安。他给我带来了正确的想法。找到了错误。

有些领域在“类型”中出现了双精度,因此只有最后一次出现的内容保存到数据库中。:-)

 类似资料:
  • 我正在尝试在我的设计表单上添加一个额外的字段,如下所示: 我必须允许额外的字段,所以我创建了一个新的初始值设定项devise_permitted_parameters.rb,如下所示 输出如下: "email"=? LIMIT?[["email","wtgwg@gmail.com "], ["LIMIT",1]]SQL(1.1ms)插入到"用户"("email","encrypted_passwo

  • 我在TYPO3 6.2.11中设置了当前extension_builder的扩展。后端中的FAL文件上传不工作。 extension_builder说文件上传在extbase中根本没有实现,但据我所知(参见https://github.com/helhum/upload_example),这是关于FE上传的。正确吗? 我只需要完全定期上传文件-通过“创建新关系”或“选择”选择 直接上传失败"上传失

  • 我在片段中有一个回收器来显示firestore中集合中的文档,问题是,它只从文档中检索某些字段,看起来它忽略了模型类中的其他一些Setter字段,这是我得到的错误: W/Firestore:(0.6.6-dev)[zzko]:在com类中找不到sabado的setter/field。实例denilsondasilva。iasdmt。com。实例denilsondasilva。com。实例denil

  • danger 该操作适用于 SDK version >= v1.3.0 字段过滤 使用 select 来控制请求返回的字段 在 get 方法中使用 var Product = new wx.BaaS.TableObject(tableID) // 规定返回特定字段 Product.select('created_at').get(recordID) // or Product.select(['c

  • 我有Fragment1和fragment2。Fragment1是EditTexts的一种形式,它将其数据保存到文本文件中。我希望用户能够在Fragment1和Fragment2之间来回滑动,每次滑动时,来自Fragment1的数据都会保存到一个文件中。 到目前为止,我已经使用ViewPager将每个表单实现为一个新的片段,并使用在用户每次滑动时保存文件。这是可行的,但用户输入的数据完全为空。 这是

  • 问题内容: 我们正在使用SQL Server 2008,其中一项要求是在为系统定义的实体上具有可扩展的用户定义属性。例如,我们可能有一个名为Doctor的实体,我们希望系统管理员能够定义通常不在系统中的其他属性。这些属性很可能是链接父表或联接表的查询条件所必需的。 将有定义属性(名称,描述,类型)等的表,但是我的问题是实际数据值的存储。 我不是DBA(只是一个假装成程序员的DBA),但我首先想到的