HTML text field shows undefined when not editing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alasdaircr
    Active Community Member
    • Aug 2014
    • 525

    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?
  • yuri
    Member
    • Mar 2014
    • 8453

    #2
    Weird. As a workaround try to set 'default' value as an empty string.
    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

    • alasdaircr
      Active Community Member
      • Aug 2014
      • 525

      #3
      No that didn't fix it

      Comment

      • yuri
        Member
        • Mar 2014
        • 8453

        #4
        Undefined is shown in Detail mode after you create the record with empty description ?
        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

        • alasdaircr
          Active Community Member
          • Aug 2014
          • 525

          #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

          • yuri
            Member
            • Mar 2014
            • 8453

            #6
            Can't reproduce it. I beleive need to dig here: file https://github.com/espocrm/espocrm/b...lds/wysiwyg.js
            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

            • alasdaircr
              Active Community Member
              • Aug 2014
              • 525

              #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

              • yuri
                Member
                • Mar 2014
                • 8453

                #8
                What is stored in DB?
                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

                • alasdaircr
                  Active Community Member
                  • Aug 2014
                  • 525

                  #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

                  • panuweb
                    Member
                    • Jun 2015
                    • 65

                    #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

                    • yuri
                      Member
                      • Mar 2014
                      • 8453

                      #11
                      Thank you
                      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

                      Working...