首页 > 解决方案 > TYPO3 安装我自己的插件后,我得到了一个列表错误

问题描述

我的 TYPO3 版本是 10.4.21,我使用扩展(流体样式的内容、站点包、Bootstrap、pizpalue 和我自己制作的插件)。

我创建了一个名为 New Flipbox 的插件,因为我必须为我的项目工作制作一个具有 Flipbox 功能的新内容元素。但我有一个错误。

如果我单击左侧菜单上的列表按钮,则会发生错误:

糟糕,发生错误!使用参数 [1]执行“SELECT uidFROM tx_myextensionkey_domain_model_newflipboxWHERE ( tx_myextensionkey_domain_model_newflipbox. pid= ?) AND (( tx_myextensionkey_domain_model_newflipbox. deleted= 0) AND (( tx_myextensionkey_domain_model_newflipbox. t3ver_wsid= 0) AND ( tx_myextensionkey_domain_model_newflipbox. = 0))) LIMIT 1时发生异常 :SQLSTATE [42S02]:t3ver_oid未找到基表或视图:1146 表 'd037b84f.tx_rsnmizukiflipbox_domain_model_newflipbox' 不存在

我该如何解决?

目前,我已经写下了这些:

在 /typo3conf/ext/myextension/Configuration/TCA/Overrides/tt_content.php 中:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
   array(
       'My Flipbox',
       'rsnflipbox',
       'EXT:core/Resources/Public/Icons/T3Icons/content/content-carousel-image.svg'
   ),
   'CType',
   'myextensionkey'
);

 // Configure the default backend fields for the content element
$GLOBALS['TCA']['tt_content']['types']['flipbox_contentelement'] = [
    'showitem' => '
          --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
             --palette--;;general,
             header; Internal title (not displayed),
             bodytext;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext_formlabel,
          --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
             --palette--;;hidden,
             --palette--;;access,
       ',
    'columnsOverrides' => [
       'bodytext' => [
          'config' => [
             'enableRichtext' => true,
             'richtextConfiguration' => 'default',
          ],
       ],
    ],
 ];

在 /typo3conf/ext/myextension/ext_location.php

    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
        'mod {
            wizards.newContentElement.wizardItems.plugins {
                elements {
                    newflipbox {
                        iconIdentifier = content-dashboard
                        title = LLL:EXT:myextensionkey/Resources/Private/Language/locallang_db.xlf:tx_myextensionkey_newflipbox.name
                        description = LLL:EXT:myextensionkey/Resources/Private/Language/locallang_db.xlf:tx_myextensionkey_newflipbox.description
                        tt_content_defValues {
                            CType = list
                            list_type = key_newflipbox
                        }
                    }
                }
                show = *
            }
       }'
    );

    // wizards bei Plugin
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
        'mod {
            wizards.newContentElement.wizardItems.interactive {
                elements {
                    newflipbox {
                        iconIdentifier = content-dashboard
                        title = LLL:EXT:myextensionkey/Resources/Private/Language/locallang_db.xlf:tx_myextensionkey_newflipbox.name
                        description = LLL:EXT:myextensionkey/Resources/Private/Language/locallang_db.xlf:tx_myextensionkey_newflipbox.description
                        tt_content_defValues {
                            CType = list
                            list_type = key_newflipbox
                        }
                    }
                }
                show = *
            }
       }'
    );

    $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
    $iconRegistry->registerIcon(
        'myextensionkey-plugin-newflipbox',
        \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
        ['source' => 'EXT:myextensionkey/Resources/Public/Icons/user_plugin_newflipbox.svg']
    );
});

在 /typo3conf/ext/myextension/Configuration/TypoScript/setup.typoscript

lib.contentElement {
    templateRootPaths.200 = EXT:myextensionkey/Resources/Private/Templates/
}

lib.contentElement {
    partialRootPaths.200 = EXT:myextensionkey/Resources/Private/Partials/
}

lib.contentElement {
    layoutRootPaths.200 = EXT:myextensionkey/Resources/Private/Layouts/
}

tt_content {
    flipbox_contentelement =< lib.contentElement
    flipbox_contentelement {
        templateName = NewContentElement
    }
}

我看到一个 TYPO3 的网站(https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/ContentElements/AddingYourOwnContentElements.html)来创建元素内容,但我不能继续因为一些错误。

我现在该怎么办?我希望有一个人可以帮助我。

谢谢你。

标签: typo3

解决方案


错误消息清楚地指出该表tx_rsnmizukiflipbox_domain_model_newflipbox丢失。因此,您应该检查是否添加了带有必要数据库字段的 ext_tables.sql,然后您应该转到安装工具并进行数据库比较以创建缺失的表。


推荐阅读