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

Issue #1944 reappeared in GLPI 9.5.10/9.5.11 #13202

Closed
2 tasks done
nsalguero opened this issue Nov 4, 2022 · 3 comments
Closed
2 tasks done

Issue #1944 reappeared in GLPI 9.5.10/9.5.11 #13202

nsalguero opened this issue Nov 4, 2022 · 3 comments
Labels

Comments

@nsalguero
Copy link
Contributor

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

9.5.11

Bug description

Hi,

In GLPI 9.5.10/9.5.11, the issue #1944 reappeared because TinyMCE version 5.10.6 seems to have replaced the event SaveContent by PostProcess.

To solve the problem, here is my patch:

--- glpi/inc/html.class.php.orig        2022-11-04 11:44:35.798454357 +0100
+++ glpi/inc/html.class.php     2022-11-04 11:35:17.132208052 +0100
@@ -3972,6 +3972,9 @@ JS;
                      });
                   }

+                  editor.on('PostProcess', function (contentEvent) {
+                     contentEvent.content = contentEvent.content.replace(/\\r?\\n/g, '');
+                  });
                   editor.on('SaveContent', function (contentEvent) {
                      contentEvent.content = contentEvent.content.replace(/\\r?\\n/g, '');
                   });

I cannot check if that problem also occurs with GLPI 10.0.4/10.0.5 or not.

Best regards,

Nicolas Salguero.

Relevant log output

No response

Page URL

No response

Steps To reproduce

Enter some text containing line feed in a followup, for example and save it.

Your GLPI setup information

No response

Anything else?

No response

@cedric-anne
Copy link
Member

Hi,

On my side, I have additionnal empty lines in followups, but I do not see rn strings. Have you some plugins active ? Could you check with no active plugins if the problem persists ?

Regards

@nsalguero
Copy link
Contributor Author

Hi,

After some tests, I now see that rn strings only appear with tickets that are generated with FormCreator. In all other situations, there are additional empty lines.

The patch I provided fixes the two problems.

Best regards,

@cedric-anne
Copy link
Member

Thanks for your patch, I added it on 9.5 branch: ade4d2e

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

2 participants