Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GLPI 10.0.10] Loss of solution template formatting #15636

Closed
2 tasks done
RobertoMarcelino opened this issue Sep 26, 2023 · 11 comments
Closed
2 tasks done

[GLPI 10.0.10] Loss of solution template formatting #15636

RobertoMarcelino opened this issue Sep 26, 2023 · 11 comments
Labels
Milestone

Comments

@RobertoMarcelino
Copy link

RobertoMarcelino commented Sep 26, 2023

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

GLPI 10.0.10

Bug description

I have ready-made solutions for answering tickets in Home / Setup / Dropdowns / Solution templates.

In versions prior to 10.0.10, what was configured was what appeared when we added the solution to the ticket.

image

Now, the formatting is being disregarded.

Excerpt from the solution's source code:

image

As it appears when we insert the solution template in the ticket:

image

Excerpt from the solution source code inserted into the ticket:

image

Relevant log output

No response

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

@cedric-anne
Copy link
Member

Maybe it is related to #15531.

@RobertoMarcelino
Copy link
Author

This is not an image but pure HTML text.

I changed the default font and added an HTML table, and when we add it to the ticket, the formatting is lost.

@M-Falken
Copy link
Contributor

M-Falken commented Sep 28, 2023

Same issue for me
That's because some html tag are not authorised in the tinymce configuration.
For example we must have :
valid_elements: "@[class],p[style],h3,h4,h5,h6,a[href|target],strong/b,"
+ "div[align],br,table,tbody,thead,tr,td,ul,ol,li,img[src]"
valid_children : "+body[style]"

All in the tniymce js file, and in src/Html.php
But what I don't understand is that it seems all allowed by default for Tinymce and only iframe are blocked, but when I save a template all is lost.

I wish that we have more settings in the general configuration to tweak the editor as we need.
Because I must redo my hacks for every glpi update.

@RobertoMarcelino
Copy link
Author

Where did you add those hacks?

@jussara-ti
Copy link

jussara-ti commented Oct 9, 2023

Hi, same issue here.
In version 10.0.10 colors and the text alignment in tables are lost when i add a solution through solution templates.

Further, my table columns are a little strange too. Even setting the table width to 100%, the columns don't occupy all the width and columns without content are shrink. For me, this is happening with solution and tasks templates.

In the template:
image

In the task:
image

@RobertoMarcelino
Copy link
Author

@M-Falken Where did you add those hacks?

@RobertoMarcelino
Copy link
Author

Same issue for me That's because some html tag are not authorised in the tinymce configuration. For example we must have : valid_elements: "@[class],p[style],h3,h4,h5,h6,a[href|target],strong/b," + "div[align],br,table,tbody,thead,tr,td,ul,ol,li,img[src]" valid_children : "+body[style]"

All in the tniymce js file, and in src/Html.php But what I don't understand is that it seems all allowed by default for Tinymce and only iframe are blocked, but when I save a template all is lost.

I wish that we have more settings in the general configuration to tweak the editor as we need. Because I must redo my hacks for every glpi update.

Where did you add those hacks?

In which files do you add these changes?

@RobertoMarcelino
Copy link
Author

Hello @M-Falken.

Could you help us by telling us which files and on which lines you made the changes in tinymce?

We'd really appreciate your contribution.

@trasher
Copy link
Contributor

trasher commented Oct 20, 2023

If I correctly understand, the initial issue was HTML tags/attributes, like table are removed when adding a solution (directly, not from a template).
#15839 may address this, you can test (not yet validated, accepted solution may be different).

(seems like solution is worst than original issue)

Note for those who edit GLPI files: all will be overriden on next GLPI update.

@trasher
Copy link
Contributor

trasher commented Oct 20, 2023

Please try #15840

cedric-anne added a commit to cedric-anne/glpi that referenced this issue Oct 20, 2023
@cedric-anne cedric-anne added this to the 10.0.11 milestone Oct 21, 2023
@M-Falken
Copy link
Contributor

Hello @M-Falken.

Could you help us by telling us which files and on which lines you made the changes in tinymce?

We'd really appreciate your contribution.

oops sorry, I didn't receive the notification
I found this in various posts on the web because I already had the problem under GLPI 9.5.
Today it's a little different with GLPI v10, but you can check these files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants