[MAGNOLIA-8278] Issues When Using Special Characters Within Alt Text Attribute Of <img> Elements In A Rich Text Field Of A Content App's Detail SubApp Editor Created: 21/May/20  Updated: 13/Jan/22  Resolved: 11/Jan/22

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 5.7.6, 6.2.1
Fix Version/s: 6.2.16

Type: Bug Priority: Neutral
Reporter: Julian Nodarse Assignee: Quach Hao Thien
Resolution: Fixed Votes: 0
Labels: VN-Maintenance, maintenance, to-verify
Remaining Estimate: Not Specified
Time Spent: 1d 0.5h
Original Estimate: Not Specified

Attachments: XML File config.modules.contacts.apps.contacts.subApps.detail.editor.form.tabs.test_tab.xml    
Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Date of First Response:
Sprint: Nucleus 1
Story Points: 3

 Description   

There is an issue with creating alt text within <img> elements in a rich text field of a content app's editor. This happens when using special characters within the alt text i.e. “$”.

Steps to Reproduce
1 - Create a new rich text field within a content app’s detail subapp editor form (you can do this within the contact app for example. You can use my attached config)
2 - Open content app to where you have the new rich text field you just created.
3 - Click on the “Source” button within the rich text field
4 - Create an <img> element with some alt text containing a special character (example : <img src="https://picsum.photos/200/300" alt="This value $9 may cause a problem when editing." >)
5 - Click save

6 - You will then get error message: " 'IndexOutOfBoundsException: No group x' error..." or if you reopen the content detail subapp you will see that the inputted element does not appear

Expected Results
No error is thrown when using an <img> element with alt text containing a special character. The element is saved and continues to persist on the rich text editor.

Actual Results
In one case you receive error:

"IndexOutOfBoundsException: No group x" error...

In another, the content will not persist within the rich text editor. However, the content does get stored within the JCR.

Workaround
Use the HTML entity of the character instead i.e. $

Development Notes
I was able to replicate the error only once by using the demo war for 5.7.6 and Tomcat 9.0.10. Attached ticket mentions that they keep getting the error though. Other times, the content would not appear on the rich text editor after clicking save. This is also seen in the demo (6.2.1 - not the error message but the blank content problem)



 Comments   
Comment by Adam Siska [ 11/Jan/22 ]

For RN:
Richtext field no longer throws error when special character ($) is used in alt text within <img> element.

Generated at Mon Feb 12 04:31:15 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.