IE9 中的 Magento 网站,原型错误

发布于 2024-10-23 13:37:19 字数 611 浏览 2 评论 0原文

Internet Explorer 9 今天发布了,我决定检查一下我们在过去几个月中构建的一些 Magento 站点,看看新版本是否一切正常。

但不幸的是事实并非如此。我遇到了一个特殊问题,该问题是由 Magento 附带的原型库版本(版本 1.6.0.3)引起的。

事件处理程序中的取消事件似乎不起作用。
例如,如果您尝试登录 Magento 商店,并且将登录名和密码字段留空,即使出现错误,IE9 也会提交表单,并且刷新后错误就会消失。
所以我认为这是一个很大的问题。

所以我的问题是:我们如何处理这个问题?我看到有几种方法可以解决这个问题:

  • 等待 Magento 发布带有修复程序的新版本
  • 将原型库升级到最新版本,该版本可能已经解决了该问题
  • 弄乱现有库并尝试修复其中的错误

等待新的 Magento 版本并不是一个好主意,因为可能需要几周时间才能发布,而且如果您运行的是非常旧的 Magento 版本,这会导致很多其他问题。
升级到最新的原型库可能是最好的主意,但是 Magento 中的所有内容都将继续与最新版本的原型一起工作,有人有这方面的经验吗?

那么大家对于这个问题有何看法呢? 除了我的想法之外还有什么想法吗?

Internet Explorer 9 was released today, and I decided to check a few Magento sites we build in the last couple of months to see if everything continues to work with the new version.

But unfortunately it doesn't. I came across one particular problem that is caused by the version of the prototype library which is shipped with Magento, version 1.6.0.3.

It looks like the cancelling events in eventhandlers isn't working.
For example, if you try to log in to a Magento shop, and just leave the login and password fields empty, IE9 submits the form even if there were errors, and the errors disappear after the refresh.
So that's quite a big problem I think.

So my question is: how can we deal with this problem? I see a couple of ways to deal with this:

  • Wait for Magento to release a new version with fixes
  • Upgrade the prototype library to the latest version which probably already has fixed the issue
  • Mess around in the existing library and try to fix the bug in there

Waiting for a new Magento release isn't a good idea because it probably will take a few weeks before there is one, and because it will cause a whole lot of other problems if you are running a very old version of Magento.
Upgrading to the latest prototype library is probably the best idea, but will everything in Magento continue to work with the latest version of prototype, does anybody has any experience with this?

So what's everybody's opinion about this problem?
Any ideas other than mine?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

顾冷 2024-10-30 13:37:19

由于升级 Prototype 有可能破坏 Magento 中的很多东西(而且,老实说,在 Magento 中做任何事情都有可能破坏 Magento 中的很多东西),我为我的项目创建了一个主题覆盖

app/code/design/frontend/{package}/{theme}/template/page/html/head.phtml

文件并将以下内容作为 head 标签下的第一个元素:

< ;meta http-equiv="X-UA-Compatible" content="IE=8" />

这告诉 IE 在可能的情况下假装是 IE 8。这解决了一个问题,例如,如果您只启用了一种付款方式,则无法签出并完成付款流程,如在 IE 9 中,字段将全部显示为灰色。

请注意,它确实必须是 下的第一个标签。

由于以任何方式升级 Magento 都有可能导致问题,我认为这是近期解决问题的侵入性最小的方法。

As upgrading Prototype has the potential to break a lot of things in Magento (and, honestly, doing anything in Magento has the potential to break a lot of things in Magento), I created a theme override for my

app/code/design/frontend/{package}/{theme}/template/page/html/head.phtml

file and slapped the following as the first element under the head tag:

<meta http-equiv="X-UA-Compatible" content="IE=8" />

This tells IE to pretend as if it is IE 8, where possible. This solved an issue where, for example, you could not check out and complete the payment process if you only have one payment method enabled, as in IE 9 the fields will all be grayed out.

Note that it really must be the first tag underneath the <head>.

Since upgrading Magento in any way has the potential to cause problems, I feel this is the least intrusive way to solve the issue in the near term.

回眸一笑 2024-10-30 13:37:19

已解决: http://www.alexanderinteractive.com/blog/2011/10/solving-the-ie-7-ie-9-magento-prototype-validation-bug/
我花了几天时间研究这个问题,发现唯一真正有效的方法是在表单级别禁用某些功能。这应该可以解决您的所有问题。

Solved: http://www.alexanderinteractive.com/blog/2011/10/solving-the-ie-7-ie-9-magento-prototype-validation-bug/
I spent a couple days on this, and discovered the only thing that truly works is disabling things at the form level. This should solve all your problems.

转角预定愛 2024-10-30 13:37:19

作为快速修复,我想我会采取与您提倡的相同方法,并将 Prototype 升级到不包含此问题的版本。然而,Magento 将附带一个补丁(这太大了,无法忽略),此时,明智的做法是撤消您的更改并应用他们提供的补丁,以与正常升级保持一致。

手动挖掘 Magento JS 的内部结构很少值得,所以这个选项对我来说似乎有点不对劲。可能有几个地方使用了这种语义,您可能会错过其中的一些。

希望有帮助!

谢谢,
约瑟夫·马斯蒂

As a quick fix, I think I would take the same approach you are advocating, and upgrade Prototype to a version that does not contain this issue. However, Magento will be coming along with a patch (this is too big to ignore), and at that point, it would be wise to undo your changes and apply the patch they provide to keep in line with normal upgrades.

It is rarely worth it to manually dig in the internals of Magento's JS, so that option seems a bit off to me. There are probably several places where this semantic is used and you may miss some of them.

Hope that helps!

Thanks,
Joseph Mastey

顾冷 2024-10-30 13:37:19

我已将 prototype.js 文件更新为 1.7,到目前为止它是正确的。我没有看到任何错误。如果您更新并发现错误,请通知!

I've updated the prototype.js file to 1.7 and so far it's correct. I dont see any errors. If you apdate and find errors please notify!

山人契 2024-10-30 13:37:19

正确的修复方法位于 Magento 论坛

template/catalog/product/view/tabs.phtml 中,将以下行更改为

ul.select('li', 'ol').each(function(el){

ul.select('li').each(function(el){

The proper fix is in the Magento forums.

In template/catalog/product/view/tabs.phtml, change the line that reads:

ul.select('li', 'ol').each(function(el){

to

ul.select('li').each(function(el){
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文