processmaker icon indicating copy to clipboard operation
processmaker copied to clipboard

Bugfix/FOUR-5296: Textarea Rich text change format of data after 2 tasks

Open agustinbusso opened this issue 3 years ago • 4 comments

Issue & Reproduction Steps

We are using the Text area Rich text on our screen, but the format of HTML is being changed after 2 derivations. When you have a rich text area but you are in a screen that does not have that rich text area, all data that is not present on that screen are sanitized. This happens after 2 derivations, or having a rich text area inside a loop or nested screen.

Solution

  • Added a column do_not_sanitize to processRequest table so we can remember and get available all the variables in the entire process.
  • Search inside nested screens and loops before sanitize.

How to Test

  • Create a process with 3 tasks. For the first and last task use a screen with a text area control with the rich text option enabled. In the second task place any control but be sure to not to use the text area in the second task. Run a request and fill the text area with some formatted text, in the last task the formatted text should not be sanitized for text area.
  • Same steps as before but use a process with a text area inside a nested screen.
  • Same steps as before but use a process with a text area inside a loop.
  • Same steps as before but use a process with a text area inside a second page.

Run test cases inside tests/Feature/Api/SanitizeHelperTest

Working videos

Case 1 after two tasks

https://user-images.githubusercontent.com/90727999/154064687-618a30e3-d547-4307-90bb-7e68be3b152a.mov

Case 2 inside nested

https://user-images.githubusercontent.com/90727999/154065430-f486308c-15b0-4d19-836f-22e4d1ef792a.mov

Case 3 inside loops

https://user-images.githubusercontent.com/90727999/154065815-d861d510-60ef-4317-8711-92110acc345e.mov

Case 4 different pages

https://user-images.githubusercontent.com/90727999/154066370-0f808701-5156-43b7-b294-162e64048698.mov

Case 5 subprocess

https://user-images.githubusercontent.com/90727999/154066894-0840e69c-3b83-45e2-860a-fd6cbf41c506.mov

Related Tickets & Packages

Code Review Checklist

  • [ ] I have pulled this code locally and tested it on my instance, along with any associated packages.
  • [ ] This code adheres to ProcessMaker Coding Guidelines.
  • [ ] This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • [ ] This solution fixes the bug reported in the original ticket.
  • [ ] This solution does not alter the expected output of a component in a way that would break existing Processes.
  • [ ] This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • [ ] This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • [ ] This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • [ ] This ticket conforms to the PRD associated with this part of ProcessMaker.

agustinbusso avatar Feb 15 '22 13:02 agustinbusso

QA server was successfully deployed https://bugfix-four-5296-processmaker.ci.processmaker.net

pmkerberos avatar Feb 15 '22 13:02 pmkerberos

QA server was successfully deployed https://bugfix-four-5296-processmaker.ci.processmaker.net

pmkerberos avatar Feb 15 '22 21:02 pmkerberos

QA server was successfully deployed https://bugfix-four-5296-processmaker.ci.processmaker.net

pmkerberos avatar Feb 16 '22 12:02 pmkerberos

QA server was successfully deployed https://bugfix-four-5296-processmaker.ci.processmaker.net

pmkerberos avatar Feb 18 '22 19:02 pmkerberos