UVdesk

    • Register
    • Login
    • Search
    • Recent

    Solved Html entities in the database.

    Technical Help
    3
    21
    443
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      theochvas last edited by theochvas

      Hi,
      When an agent enters greek text in the html editor in the ticket message field, the text is saved as html entities in the db (& Omicron;& Nu;& Omicron;& Mu;& Alpha; etc...).
      This causes a problem when we want to export the data directly from the mysql. Is there a workaround for this?
      Can we maybe completely disable the html editor and enter only plain text in every field?

      Thank you & a Happy New Year!

      1 Reply Last reply Reply Quote 0
      • T
        theochvas @peopleinside last edited by

        @peopleinside
        Hi and thank you both for the time you spend on my problem.
        I managed to find a solution by editing the initialization of tinyMCE in ticket.html.twig & savedReplyForm.html.twig
        I added the lines

        sfTinyMce.init({
        ...
              entity_encoding: "raw",
              forced_root_block : "",
        ...
        

        and now the greek text is saved as readable text in the db.

        Cheers!

        peopleinside 1 Reply Last reply Reply Quote 0
        • peopleinside
          peopleinside community specialist mod admin last edited by peopleinside

          @theochvas thank you for your question!
          A developer will reply as soon as possible, if not feel free to write back here.

          Happy Holidays and Happy New Year!

          UVdesk passionate | Community moderator | External consultant

          If you need help with the community you can visit https://helpdesk.peopleinside.it/it/blog/uv
          You can always get in touch also with the UVdesk team
          https://support.uvdesk.com/en/

          1 Reply Last reply Reply Quote 0
          • Sanjeev
            Sanjeev developer UVdesk Staff mod last edited by

            @theochvas said in Html entities in the database.:

            e completely disable the html editor and enter only plain text in every field?

            Actually editor always saves data as same as you write on it (like spacing, colors, bold text etc) so that we always make it save as same on database.

            But when we fetch it from our database then we just parse HTML and show the same on front end without any html tag.

            So if you will export Database you will simply receive all HTMl with content.

            1 Reply Last reply Reply Quote 0
            • T
              theochvas last edited by

              So if you will export Database you will simply receive all HTMl with content.

              Yes, that would be ok with english text, but greek text is unreadable when inside html in the database because it's saved as html entities: όνομα -> '& Omicron;& Nu;& Omicron;& Mu;& Alpha;' .
              And so the export is also unreadable.
              Can i disable the html editor in the ticket message field and enter plain text instead?
              Thank you.

              1 Reply Last reply Reply Quote 0
              • Sanjeev
                Sanjeev developer UVdesk Staff mod last edited by

                @theochvas

                Locate path:
                vendor/uvdesk/core-framework/views/ticket.html.twig

                Open ticket.html.twig and remove line from here.

                1 Reply Last reply Reply Quote 0
                • T
                  theochvas last edited by

                  Now, i get an error when i try to edit a message or add an answer

                  Uncaught ReferenceError: tinyMCE is not defined

                  peopleinside 1 Reply Last reply Reply Quote 0
                  • peopleinside
                    peopleinside community specialist mod admin @theochvas last edited by

                    @theochvas please try to clear cache, you can do in dashboard main page at right bottom (dark trash icon) or by SSH with command: php bin/console c:c

                    UVdesk passionate | Community moderator | External consultant

                    If you need help with the community you can visit https://helpdesk.peopleinside.it/it/blog/uv
                    You can always get in touch also with the UVdesk team
                    https://support.uvdesk.com/en/

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      theochvas @peopleinside last edited by

                      @peopleinside said in Html entities in the database.:

                      php bin/console c:c

                      I tried clearing the cache both ways, but i still get when the ticket page loads:

                      Uncaught ReferenceError: sfTinyMce is not defined
                      at 409:4210

                      Uncaught TypeError: sfTinyMceNew2.init is not a function
                      at InitTinyMce (409:4230)
                      at r.initialize (409:3103)
                      at r.e.View (backbone.js:1300)
                      at new r (backbone.js:2060)
                      at HTMLDocument.<anonymous> (409:4180)
                      at e (jquery.min.js:2)
                      at t (jquery.min.js:2)

                      and when i try to edit a ticket message

                      Uncaught ReferenceError: tinyMCE is not defined
                      at r.fn (409:2826)
                      at Object.fn (backbone-validation-min.js:8)
                      at nr (underscore-min.js:6)
                      at Object.<anonymous> (underscore-min.js:6)
                      at Object.fn (underscore-min.js:6)
                      at backbone-validation-min.js:8
                      at r (underscore-min.js:6)
                      at Function.<anonymous> (underscore-min.js:6)
                      at i (backbone-validation-min.js:8)
                      at r.<anonymous> (backbone-validation-min.js:8)

                      peopleinside 1 Reply Last reply Reply Quote 0
                      • Sanjeev
                        Sanjeev developer UVdesk Staff mod last edited by

                        @theochvas said in Html entities in the database.:

                        Uncaught ReferenceError: sfTinyMce is not defined
                        at 409:4210

                        As tinymce is used here with many function so it will create an issue. you can check all file and instead of getting value through tinymce use simple testarea value.

                        1 Reply Last reply Reply Quote 0
                        • peopleinside
                          peopleinside community specialist mod admin @theochvas last edited by

                          @theochvas what steps do you follow for see an error in UI?
                          When you say edit ticket what steps you follow to edit a ticket?
                          I tried to edit a ticket as admin but i get no error.

                          You cannot edit ticket messages in a ticket, you can maybe only edit the initial ticket created, right?

                          Also what version of database are you using?
                          I discovered with another open source app that when I migrated from Mysql 5.7 to MAriaDB I resolved issues on importing a backup of that opensource... before I had always an issue on exportation so maybe are you sure the issue is not maybe ... the database app used?

                          UVdesk passionate | Community moderator | External consultant

                          If you need help with the community you can visit https://helpdesk.peopleinside.it/it/blog/uv
                          You can always get in touch also with the UVdesk team
                          https://support.uvdesk.com/en/

                          T 1 Reply Last reply Reply Quote 0
                          • Topic has been marked as solved  peopleinside peopleinside 
                          • T
                            theochvas @peopleinside last edited by theochvas

                            @peopleinside I click on 'Edit Ticket', the modal appears, but the Update button does nothing & i get the error in the browser console.
                            Same for leaving a reply: The 'Reply' button does nothing & i get the error.

                            The db is MySQL 8.0.24

                            peopleinside 2 Replies Last reply Reply Quote 0
                            • peopleinside
                              peopleinside community specialist mod admin @theochvas last edited by

                              @theochvas I am unable to reproduce on the latest version and with the edit suggested in the previous developer reply.

                              Can you try to reproduce in a new test instance of UVdesk?

                              UVdesk passionate | Community moderator | External consultant

                              If you need help with the community you can visit https://helpdesk.peopleinside.it/it/blog/uv
                              You can always get in touch also with the UVdesk team
                              https://support.uvdesk.com/en/

                              1 Reply Last reply Reply Quote 0
                              • peopleinside
                                peopleinside community specialist mod admin @theochvas last edited by

                                @theochvas The error is resolved if you revert back edits suggested from the developer?
                                Maybe you are having issue for a not fully correct resume of your existing install? Is restored from a database import?

                                UVdesk passionate | Community moderator | External consultant

                                If you need help with the community you can visit https://helpdesk.peopleinside.it/it/blog/uv
                                You can always get in touch also with the UVdesk team
                                https://support.uvdesk.com/en/

                                T 1 Reply Last reply Reply Quote 0
                                • T
                                  theochvas @peopleinside last edited by

                                  @peopleinside

                                  The error is resolved if you revert back edits suggested from the developer?

                                  Yes.

                                  Maybe you are having issue for a not fully correct resume of your existing install? Is restored from a database import?

                                  Sorry, i'm not sure what you mean here. The installation is 1.0.18 done through the web installation wizard.

                                  peopleinside 1 Reply Last reply Reply Quote 0
                                  • peopleinside
                                    peopleinside community specialist mod admin @theochvas last edited by

                                    @theochvas I understand why I was not able to reproduce: I replaced the file with the suggested file instead of delete the suggested line.

                                    In your initial message you said:

                                    When an agent enters greek text in the html editor in the ticket message field, the text is saved as html entities in the db (& Omicron;& Nu;& Omicron;& Mu;& Alpha; etc...).
                                    This causes a problem when we want to export the data directly from the mysql.

                                    You are having an issue in the database export if in the ticket there is a Greek text?
                                    Greek is the language? The issue you are facing is only with that language I suppose?

                                    Once the database exported if you import again you are so unable to restore correctly the ticket system? This question to understand if you are reporting an issue on exporting database so in backup correctly UVdesk for a future resume.

                                    Why you export the database, for backup purpose?

                                    UVdesk passionate | Community moderator | External consultant

                                    If you need help with the community you can visit https://helpdesk.peopleinside.it/it/blog/uv
                                    You can always get in touch also with the UVdesk team
                                    https://support.uvdesk.com/en/

                                    T 1 Reply Last reply Reply Quote 0
                                    • T
                                      theochvas @peopleinside last edited by

                                      @peopleinside Yes, the problem is with greek text when entered in the html-editor.
                                      I have not tried to import the backup to the db,
                                      The export made is for reporting and backup of the tickets.

                                      The 'message' field in the 'Create New Ticket' modal is plain text instead of tinyMCE, can i maybe alter the 'message' field code in the 'Edit Ticket' & 'Reply to ticket' Forms to also not load the tinyMCE editor?

                                      Thank you for your time.

                                      peopleinside 1 Reply Last reply Reply Quote 0
                                      • peopleinside
                                        peopleinside community specialist mod admin @theochvas last edited by

                                        @theochvas with greek text you mean Greek language?

                                        Sorry if I ask but English is not my primary language and I may have some difficulty in understanding . I suppose is the Grek language, i don't know that language as I use Italian and English.

                                        I have not tried to import the backup to the db,
                                        The export made is for reporting and backup of the tickets.

                                        Umh if the scope is the backup I suggest to simply made a try to backup than resume, maybe in a duplicate instance of test, the backup. If the backup is resumed correctly, ticket are showed correctly I think you should not worry how the database is exported.

                                        The 'message' field in the 'Create New Ticket' modal is plain text instead of tinyMCE

                                        n a last update of UVdesk a text editor has been added in visitor side but also on operator side. This has been done because with the normal text field the formatting of text was not respected in email and ticket as well. See this issue: https://github.com/uvdesk/community-skeleton/issues/510 so introducing a text editor is an improvement.

                                        Maybe you still have a version that has not yet last GitHub edits but you may have on next update.. so if you have not a text editor on operator ticket creation, a future update will add it.

                                        can i maybe alter the 'message' field code in the 'Edit Ticket' & 'Reply to ticket' Forms to also not load the tinyMCE editor?

                                        I don't know, I'm not a programmer but only an passionate UVdesk user that try to help in free time.

                                        I suggest to understand if you have a real problem or if your requests is a customization that can be maybe possible with the free Open Source and the free support.
                                        If you found a real issue for all, for example if you see that is not possible restore correctly tickets from a backup.. in this case I think the UVdesk staff can and should look into this because maybe all users that will have UVdesk with Greek language text can have the same issue. Be able to backup and resume is essential.

                                        Have an exported database well readable is less important... database is a storage file that should be work for resume a backup that should resume all in UI without errors.
                                        This is my point of view.

                                        UVdesk passionate | Community moderator | External consultant

                                        If you need help with the community you can visit https://helpdesk.peopleinside.it/it/blog/uv
                                        You can always get in touch also with the UVdesk team
                                        https://support.uvdesk.com/en/

                                        T 1 Reply Last reply Reply Quote 0
                                        • Sanjeev
                                          Sanjeev developer UVdesk Staff mod last edited by

                                          @theochvas

                                          Editor will always save the same text you write it over along with all your space and other changes you have done to make a proper format.

                                          So whenever you will take it from db you will get all data save in db normally we parse html data and only show the data.

                                          If there is any issue specifically for your language then you can raise an issue on github with all steps and words you are using.

                                          1 Reply Last reply Reply Quote 0
                                          • T
                                            theochvas @peopleinside last edited by

                                            @peopleinside
                                            Hi and thank you both for the time you spend on my problem.
                                            I managed to find a solution by editing the initialization of tinyMCE in ticket.html.twig & savedReplyForm.html.twig
                                            I added the lines

                                            sfTinyMce.init({
                                            ...
                                                  entity_encoding: "raw",
                                                  forced_root_block : "",
                                            ...
                                            

                                            and now the greek text is saved as readable text in the db.

                                            Cheers!

                                            peopleinside 1 Reply Last reply Reply Quote 0
                                            • Sanjeev
                                              Sanjeev developer UVdesk Staff mod last edited by

                                              @theochvas

                                              Glad to know it resolved your issue.

                                              1 Reply Last reply Reply Quote 0
                                              • First post
                                                Last post