简体   繁体   English

Magento的SUPEE-6788补丁不能与Git / Github一起使用

[英]Magento's SUPEE-6788 patch not working with Git/Github

After I successfully installed the SUPEE-6788 patch on my localhost and pushed the changes to development, I noticed a handful of issues in my dev environment that I did not see on my Localhost. 在我的localhost上成功安装SUPEE-6788补丁并将更改推送到开发之后,我注意到我的开发环境中的一些问题,我在Localhost上没有看到。

The first issue I found was that none of my contact form blocks were appearing. 我发现的第一个问题是我的联系表单块都没有出现。

Then I noticed that it wasn't limited to the contact form, it was anywhere that had a form in it (via CMS page). 然后我注意到它不仅限于联系表单,它在任何地方都有一个表单(通过CMS页面)。

After digging a bit deeper (exception stack trace), I found out that I was missing a table that didn't exist before called 'permission_block'. 在深入挖掘(异常堆栈跟踪)之后,我发现我在调用'permission_block'之前缺少一个不存在的表。

After a bit more digging, I found out that there were many database updates that occurred in the patch which did not run when pushed to development (via upgrade script). 经过一番挖掘后,我发现补丁中发生了许多数据库更新,这些更新在推送到开发时没有运行(通过升级脚本)。 Looking at the patch directly, I can see that the upgrade scripts were in fact updated, and that the config files reflected those updates (version number and all). 直接查看补丁,我可以看到升级脚本实际上已更新,并且配置文件反映了这些更新(版本号和所有)。 But for some reason, they did not run. 但由于某种原因,他们没有跑。

Now I'm left with a bit of a dilemma. 现在我有点陷入两难境地了。 I'm not sure what updates happened and what updates have not (in the development environment). 我不确定发生了什么更新以及哪些更新没有(在开发环境中)。

Are the SUPEE patches Magento releases not meant to be used in conjunction with Git/Github? SUPEE补丁Magento发布版本是不是要与Git / Github一起使用?

Do I need to apply the patch individually to each build instead of pushing the build after patching? 我是否需要将修补程序单独应用于每个构建,而不是在修补后推送构建?

Are the SUPEE patches Magento releases not meant to be used in conjunction with Git/Github SUPEE补丁Magento版本是不是要与Git / Github一起使用

There's nothing in the SUPEE patches that would prevent you from using Git/GitHub to manage your repository. SUPEE补丁中没有任何内容可以阻止您使用Git / GitHub来管理您的存储库。

That said -- your question doesn't quite make sense, and I think it may be due to a misunderstanding on how those database upgrades are applied. 这就是说-你的问题没有引起太大的意义,我认为这可能是由于对如何应用这些数据库升级的误解。

Magento Setup Resource scripts allow a module developer to update the database. Magento Setup Resource脚本允许模块开发人员更新数据库。 Whenever Magento loads an uncached HTTP request, it will 每当Magento加载未缓存的 HTTP请求时,它都会

  1. Examine the version of all declared modules in app/etc/(code|community|local) 检查app/etc/(code|community|local)的所有已声明模块的版本app/etc/(code|community|local)

  2. Compare that version to the version stored in the core_resource table 将该版本与core_resource表中存储的版本进行比较

  3. If a more recent version is installed on the file system, run the appropriate setup resource scripts in sql/ folder 如果文件系统上安装了更新版本,请在sql/文件夹中运行相应的安装资源脚本

  4. Update core_resource to indicate the version installed 更新core_resource以指示安装的版本

Based on your question, it sounds like one of the following happened 根据您的问题,听起来像下面发生的一件事

  1. You uploaded the updated files from source, but never cleared cache in production, and the setup resource scripts never ran 您从源上载了更新的文件,但从未在生产中清除缓存,并且设置资源脚本从未运行过

  2. You uploaded the updated files, did clear the cache, but something about your production system prevented the scripts from fully running. 您上传了更新的文件,确实清除了缓存,但是生产系统的某些内容阻止了脚本完全运行。 Since MySQL doesn't have transactional updates for all structure changing commands, it's possible for a setup resource script to not fully run, but still update the core_resource table with the same version. 由于MySQL没有针对所有结构更改命令的事务更新,因此设置资源脚本可能无法完全运行,但仍然使用相同版本更新core_resource表。

I'd start by comparing the extension version in core_resource with the versions on the file system (in config.xml ) 我首先将core_resource的扩展版本与文件系统上的版本进行比较(在config.xml

Also, you can use the sys:setup:incremental command that's a part of the n98-magerun program to manually apply updates without clearing the cache. 此外,您可以使用sys:setup:incremental命令,该命令是n98-magerun程序的一部分,可在不清除缓存的情况下手动应用更新。 This can also help you diagnose which, if any, failures might be causing problems. 这还可以帮助您诊断哪些故障(如果有)可能导致问题。

Finally, since you have a working development version, as a last resort you can use mysqldump to dump the structure of each database, and then compare with a visual diff tool (like WinMerge ) to determine what tables/rows are missing. 最后,由于您有一个可用的开发版本,作为最后的手段,您可以使用mysqldump转储每个数据库的结构,然后与可视化差异工具(如WinMerge )进行比较,以确定缺少哪些表/行。 You'll need to apply a bit of intelligence to this (since dev might also have other un-needed things) 你需要对此应用一些智能(因为dev可能还有其他不需要的东西)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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