简体   繁体   English

在干净的环境中安装我们的扩展时,未执行创建和更新查询 typo3 package

[英]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:我们通过以下方式创建了主题扩展:

  1. Downloaded the extension package from the site package builder( https://sitepackagebuilder.com/new/ )从站点 package builder( https://sitepackagebuilder.com/new/ ) 下载扩展 package
  2. Download and installed the TYPO3 V8.7.9 package.下载并安装TYPO3 V8.7.9 package。
  3. Then placed the extension package under the folder typo3conf/ext/ and installed the extension package in the Extension section然后将扩展package放在文件夹typo3conf/ext/下,在Extension部分安装扩展package
  4. Installed MASK and Power mail extensions because for implementing template extension we used MASK and PowerMail for form submission.安装 MASK 和 Power 邮件扩展,因为为了实现模板扩展,我们使用 MASK 和 PowerMail 进行表单提交。

  5. Then placed the theme related templates, styles, Js, typoscript inside the extension folder.然后把主题相关的模板,styles,Js,typoscript放到扩展文件夹里面。

  6. MASK content element templates are managed under the folder fileadmin//templates/content, fileadmin//templates/preview and Page content images are managed under the folder fileadmin//images, mask.json file managed under the fileadmin//. MASK 内容元素模板在文件夹 fileadmin//templates/content、fileadmin//templates/preview 下管理,页面内容图像在文件夹 fileadmin//images 下管理,mask.json 文件在 fileadmin// 下管理。 To achieve the above process, we have modified the mask backend configuration.为了实现上述过程,我们修改了掩码后端配置。
  7. After implementation of the theme extension, most features work except when we try to install our extension in another clean typo3 package it is not working.实施主题扩展后,大多数功能都可以使用,除非我们尝试在另一个干净的环境中安装我们的扩展 typo3 package 它无法正常工作。 In order to solve, we did the following changes:为了解决,我们做了如下改动:

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 - 不考虑UPDATEINSERT等修改
  • every time an extension gets installed (or the database analyzer in the TYPO3 install tool is invoked manually) the current database schema is compared to the definitions in 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 step每次安装扩展(或手动调用 TYPO3 安装工具中的数据库分析器)时,会将当前数据库模式与ext_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.sql不在ext_table.sql中评估ALTER TABLE语句 - 如果您想调整字段声明,请使用包含新字段或要更改的类型的附加CREATE语句 - 例如,TYPO3 核心的ext:felogin正在更改现有表fe_groupsfe_usershttps://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/felogin/ext_tables.sql
  • specific INSERT 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.sql特定的INSERT语句必须是文件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.sql
  • imports in a distribution package should basically happen using the file Initialisation/data.t3d which can be created using the "Import/Export Module" as being part of the TYPO3 core package分发 package 中的导入基本上应该使用文件Initialisation/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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM