Search code examples
prototypejsmagento-1.7

Prototype.js can't save attribute in magento


I have this problem with Magento 1.7, I can't save attributes, the button turns gray and nothing happens.

In firebug, I get this error message

TypeError: value.gsub is not a function     

value = value.gsub(/(\r)?\n/, '\r\n');

in prototype.js on line 5809 

Solution

  • It looks like you are trying to serialize the elements in a form and one or more of the elements do not have a value attribute to read.

    2 ways to fix - either check all your form elements and make sure they have a value='' attribute at the minimum.

    OR

    you can update the prototype.js file with some of the latest updates which has added checks to make sure the a value attribute exists before trying to act on it.

    https://github.com/jwestbrook/prototype/tree/master-w-updates/dist