typo3 - TYPO3 安装我自己的插件后,我得到了一个列表错误
问题描述
我的 TYPO3 版本是 10.4.21,我使用扩展(流体样式的内容、站点包、Bootstrap、pizpalue 和我自己制作的插件)。
我创建了一个名为 New Flipbox 的插件,因为我必须为我的项目工作制作一个具有 Flipbox 功能的新内容元素。但我有一个错误。
如果我单击左侧菜单上的列表按钮,则会发生错误:
糟糕,发生错误!使用参数 [1]执行“SELECT
uid
FROMtx_myextensionkey_domain_model_newflipbox
WHERE (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)来创建元素内容,但我不能继续因为一些错误。
我现在该怎么办?我希望有一个人可以帮助我。
谢谢你。
解决方案
错误消息清楚地指出该表tx_rsnmizukiflipbox_domain_model_newflipbox
丢失。因此,您应该检查是否添加了带有必要数据库字段的 ext_tables.sql,然后您应该转到安装工具并进行数据库比较以创建缺失的表。
推荐阅读
- php - 在chartJS中显示从数据库中提取的整数作为%
- git - git - 按时间戳忽略文件
- flutter - 选择项目后如何不关闭 PopUpMenuButton?
- php - 如何从 api 响应中获取特定值到 php 变量?
- flutter - 用户如何在 textfield 或 textformfield 中看到整个文本?
- php - 带有 GET 的多个 if 语句在带有 XPath 的 PHP 中无法正确输出
- javascript - 像其他资产一样通过 CDN URL 从动态导入中加载块
- php - 查询两个不同表中两个字段的 SUM PHP
- python - 不显示缺失值matplotlib
- python - pyenv 在 macos 上给出 shopt 命令未找到错误