Magento – magento 1.9.3.2 backend reset password error

javascriptmagento-1.9passwordprototype-js

I upgraded from magento1.9.3.0 to 1.9.3.2, the site after the reset password can not click.
The chrome browser displays an error。

Refused to execute script from
'http://localhost/js/index.php/x.js?f=prototype/prototype.js,prototype/…s,mage/adminhtml/events.js,mage/adminhtml/form.js,scriptaculous/effects.js'
because its MIME type ('text/html') is not executable, and strict MIME
type checking is enabled. captcha.js:25 Uncaught ReferenceError: Class
is not defined
at captcha.js:25 (anonymous) @ captcha.js:25 (index):40 Uncaught ReferenceError: varienForm is not defined
at (index):40 (anonymous) @ (index):40

Best Answer

I just fixed the problem for my project. For me this looks like strange behaviour of the return Content-type header.

My solution is just to patch "app/design/adminhtml/default/default/template/forgotpassword.phtml" by adding one extra GET parameter in JS request url. I added "c=auto"

I changed:

src="<?php echo $this->getJsUrl(); ?>index.php/x.js?f=prototype/prototype.js,prototy......"></script>

To:

src="<?php echo $this->getJsUrl(); ?>index.php/x.js?c=auto&f=prototype/prototype.js......"></script>

I am not going too deep in the problem but by adding c=auto we force the php script that returns the JS content to set the correct Content-type. Probably this happens because the webserver recognises that the JS file is served from js/index.php and that is why the Content-type was text/html rather than text/javascript

I think that there are 2 solutions:

  1. Fix the problem by changing webserver configuration.
  2. Patch the template file.

Cheers!

Related Topic