Bugfix/FOUR-4408: Textarea Rich Text sanitizing Incorrectly (For 4.2) #4167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue & Reproduction Steps
Format in rich text is missing when a form text area variable is passed to a second task that use that variable in a rich text control and then is passed again to another task with form text area
Reproduction steps:
Create a process with 3 tasks:
The first task will be a screen with a form text area and configured as rich text with the name form_text_area_1 with submit button.
The second task will be a screen with a rich text control. Inside de control put the name of the previous form text area name in triple mustaches {{{form_text_area_1}}} with submit button.
The third task should be the same screen from task 1.
Start a new request, and in the first task add text with some formats (bold, colors, ...), submit the data
In the second task you should see the data formatted, submit the task and in the third task you should see the data without format.
Solution
How to Test
Same as Reproduction steps. Create a process with 3 task first and last task should have the same screen with a fomr text area control with rich text option enabled. The second task should have a rich text control with the form text area control variable name in triple mustaches. It is a good idea to test it placing the second task of the process inside a subprocess, or inside a loop. There are attached a zip with some processes that cover a lot of cases:
Processes_for_testing.zip
Working video
Screen.Recording.2021-11-19.at.16.43.23.mov
Related Tickets & Packages
Code Review Checklist