[英]Create and Update queries are not being executed while installing our extension in the clean typo3 package
We have created Theme Extension in the following way:我们通过以下方式创建了主题扩展:
Installed MASK and Power mail extensions because for implementing template extension we used MASK and PowerMail for form submission.安装 MASK 和 Power 邮件扩展,因为为了实现模板扩展,我们使用 MASK 和 PowerMail 进行表单提交。
Then placed the theme related templates, styles, Js, typoscript inside the extension folder.然后把主题相关的模板,styles,Js,typoscript放到扩展文件夹里面。
7.1. 7.1. Created a new folders Initialisation, Initialisation/Extensions, Initialisation/Files under our extension folder.
在我们的扩展文件夹下创建了一个新文件夹 Initialisation、Initialisation/Extensions、Initialisation/Files。
7.2. 7.2. Placed the dependency extension packages into Initialisation/Extensions.
将依赖扩展包放入初始化/扩展中。
7.3. 7.3. Placed all the fileadmin files() into Initialisation/Files.
将所有 fileadmin files() 放入 Initialisation/Files。
7.4. 7.4. Modified the file ext_emconf.php to mentioned the extension details and its dependency extensions.
修改文件 ext_emconf.php 以提及扩展详细信息及其依赖扩展。
7.5. 7.5. Placed the exported T3d pagetree file under the folder Initialisation with the name data.t3d
将导出的 T3d pagetree 文件放在名为 data.t3d 的文件夹 Initialisation 下
7.6. 7.6. Added the following code in the file ext_localconf.php, for changing the mask backend configuration
在文件 ext_localconf.php 中添加了以下代码,用于更改掩码后端配置
<pre>
<code>
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mask'] = serialize([
'json' => 'typo3conf/ext/key-name/mask.json',
'content' => 'fileadmin/key-name/templates/content/',
'layouts' => 'fileadmin/key-name/templates/content/Layouts/',
'partials' => 'fileadmin/key-name/templates/content/Partials/',
'backend' => 'fileadmin/key-name/templates/backend/',
'layouts_backend' => 'fileadmin/key-name/templates/backend/Layouts/',
'partials_backend' => 'fileadmin/key-name/templates/backend/Partials/',
'preview' => 'fileadmin/key-name/templates/preview/',
]);
</code>
</pre>
7.7. 7.7. If we add a new content element in the mask, a mask will add a new field to the tt_content table and create a new table for storing that content element values.
如果我们在掩码中添加一个新的内容元素,掩码将向 tt_content 表添加一个新字段并创建一个新表来存储该内容元素值。 Since this theme has too many content elements, we have added the ALTER and CREATE TABLE queries in the ext_tables.sql file.
由于这个主题的内容元素太多,我们在 ext_tables.sql 文件中添加了 ALTER 和 CREATE TABLE 查询。 We have also added the UPDATE and INSERT queries for mask content element values.
我们还为掩码内容元素值添加了 UPDATE 和 INSERT 查询。
Issue: Now the issue is, points 7.6 and 7.7(Create and Update queries are not getting executed) ie not working while installing our extension in the clean typo3 package.问题:现在的问题是,第 7.6 点和第 7.7 点(创建和更新查询未被执行)即在干净的 typo3 package 中安装我们的扩展时无法正常工作。
Please let me know where we are going wrong.请让我知道我们哪里出错了。
Many thanks Regards Sharmistha非常感谢 问候 Sharmistha
This answer is based on the assumption that a "TYPO3 distribution package" shall be created.该答案基于应创建“TYPO3 分发包”的假设。 The mentioned "site package" approach in the original answer might be superfluous in case no template or backend layout definitions to render the web site frontend are being used.
如果没有使用模板或后端布局定义来呈现 web 站点前端,则原始答案中提到的“站点包”方法可能是多余的。
Creating distribution packages for TYPO3 is briefly documented here https://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/CreateNewDistribution/Index.html此处简要记录了为 TYPO3 创建分发包https://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/CreateNewDistribution/Index.html
General file locations of an extension are documented here https://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/FilesAndLocations/Index.html - especially have a look at ext_tables_static+adt.sql
which would be required to eg INSERT
or UPDATE
data explicitly.扩展的一般文件位置记录在此处https://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/FilesAndLocations/Index.html - 特别是看看
ext_tables_static+adt.sql
将或需要UPDATE
INSERT
数据明确。
Concerning SQL declarations and adjustments the following explanations are important:关于SQL申报和调整,以下说明很重要:
ext_tables.sql
only supports declaration of tables, thus only CREATE
is supported and executed - modifications like UPDATE
or INSERT
are not considered ext_tables.sql
仅支持表声明,因此仅支持和执行CREATE
- 不考虑UPDATE
或INSERT
等修改ext_table.sql
files and adjusted (altered) in case there are differences - all ext_table.sql
files of installed extensions are considered and merged at this stepext_table.sql
文件中的定义进行比较,并调整(更改)以防存在差异 - 所有ext_table.sql
文件在此步骤考虑并合并已安装的扩展ALTER TABLE
statements are not evaluated in ext_table.sql
- in case you want to adjust field declarations, use and additional CREATE
statement containing new fields or the types to be altered - eg ext:felogin
of the TYPO3 core is altering the existing tables fe_groups
and fe_users
in https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/felogin/ext_tables.sqlext_table.sql
中评估ALTER TABLE
语句 - 如果您想调整字段声明,请使用包含新字段或要更改的类型的附加CREATE
语句 - 例如,TYPO3 核心的ext:felogin
正在更改现有表fe_groups
和fe_users
在https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/felogin/ext_tables.sqlINSERT
statements have to be part of the file ext_tables_static+adt.sql
, see ext:extensionmanager
of the TYPO3 core making use of that feature in https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/extensionmanager/ext_tables_static%2Badt.sqlINSERT
语句必须是文件ext_tables_static+adt.sql
的一部分,请参阅ext:extensionmanager
of the TYPO3 core making use of that feature in https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/ typo3/sysext/extensionmanager/ext_tables_static%2Badt.sqlInitialisation/data.t3d
which can be created using the "Import/Export Module" as being part of the TYPO3 core packageInitialisation/data.t3d
进行,该文件可以使用“导入/导出模块”作为 TYPO3 核心的一部分创建 package Hope that helps.希望有所帮助。 In case there are further questions, please provide error messages or warnings and describe what you wanted to achieve in particular.
如果还有其他问题,请提供错误消息或警告,并特别描述您想要实现的目标。 Thx
谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.