Announcement

Collapse
No announcement yet.

Error after upgrading to 4.7.1: label.replace is not a function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error after upgrading to 4.7.1: label.replace is not a function

    We were unable to open some contacts after upgrading to EspoCRM 4.7.1 (may have been introduced earlier, we skipped two versions) due to a Javascript error. The error originated in client/src/views/fields/array.js in the getItemHtml() function. Label was actually an integer. Here is a patch that I created which fixes the problem:

    Code:
    --- array.js.orig    2017-06-06 18:48:25.257317470 +0200
    +++ array.js    2017-06-06 18:58:01.950878063 +0200
    @@ -288,6 +288,7 @@
                 var label = valueSanitized;
                 if (this.translatedOptions) {
                     label = ((value in this.translatedOptions) ? this.translatedOptions[value] : label);
    +                label = label.toString();
                     label = this.getHelper().stripTags(label);
                     label = label.replace(/"/g, '"');
                 }

  • #2
    Thanks

    Comment


    • #3
      Hi,

      Just for the record. The same error occurred for me on another page after upgrading (don't know exactly from which version to which as some time passed before I notice the error).

      I applied the same fix as above on the file client/src/views/admin/field-manager/fields/options.js and it seems to work.

      Comment

      Working...
      X