Announcement

Collapse
No announcement yet.

HTML text field shows undefined when not editing

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

  • HTML text field shows undefined when not editing

    I've created a field to hold HTML content, similar to emails.

    Code:
    {
        "fields": {
            ..snip..
            "description": {
                "type": "text",
                "view": "Fields.Wysiwyg"
            }
        }
    }
    And then populated the field with valid HTML content. When editing the content is shown correctly (see screenshot).


    However, by default the content is shown as 'undefined'.

    Any clues?

  • #2
    Weird. As a workaround try to set 'default' value as an empty string.

    Comment


    • #3
      No that didn't fix it

      Comment


      • #4
        Undefined is shown in Detail mode after you create the record with empty description ?

        Comment


        • #5
          I'm not creating these records, they are populated with HTML by a service (but shouldn't be different to body content from received emails).

          Undefined is shown in Detail mode when I view the record. While Editing the description, the HTML is rendered along with the summernote buttons.

          Comment


          • #6
            Can't reproduce it. I beleive need to dig here: file https://github.com/espocrm/espocrm/b...lds/wysiwyg.js

            Comment


            • #7
              Yep I've been looking in there.

              I reckon the problem is somewhere else, given that the field works for two other entities.

              I'll keep looking

              Comment


              • #8
                What is stored in DB?

                Comment


                • #9
                  DB contains the same HTML code as an email template which works.

                  I'll have a wee look at the entity setup or the views,

                  Comment


                  • #10
                    Hello

                    I found the solution to the error. I reported the problem on GitHub.

                    They have to change line 113 of the client/src/views/fields/wysiwyg.js file

                    PHP Code:
                     var body this.model.get('body'); 

                    to

                    PHP Code:
                     var body this.model.get(this.name); 

                    Greetings!

                    Comment


                    • #11
                      Thank you

                      Comment

                      Working...
                      X