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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dsp
    Junior Member
    • May 2016
    • 10

    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, '"');
                 }
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Thanks
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • huscmk
      Junior Member
      • Feb 2017
      • 17

      #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...