[MNT-11871] Adding tag with name containing new lines (\n) breaks the tagging service. Created: 09-Jul-14  Updated: 22-Jan-15  Resolved: 16-Sep-14

Status: Closed
Project: Service Packs and Hot Fixes
Component/s: Tags and Categories
Affects Version/s: 4.1
Fix Version/s: 4.2.4

Type: Service Pack Request
Reporter: Philippe Dubois [X] (Inactive) Assignee: Closed Bugs (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 day, 5 hours
Original Estimate: Not Specified

Attachments: Text File exception.txt     XML File support2.get.desc .xml     File support2.get.html.ftl     File support2.get.js    
Issue Links:
Related
Bug Priority:
Category 2
ACT Numbers:

00154086, 00184204

Build Location: http://releases.alfresco.com/Enterprise-4.2/4.2.4/build-00082/ALL/

 Description   

If tag having name containing a (\n) is created then the tags are not visible any more on the left panel in SHARE under the “Tags” root.

How to reproduce:

1) In SHARE insure that you have a site called “test” created.
2) Upload the attached webscript “support2”
3) Execute the webscript “http://localhost:8080/alfresco/service/support2
4) Browse to ore refresh page using SHARE in root of document library of TEST.

Observed result:

The elements under Tags” is empty and will stay empty.
The attached exception is raised, see exception.txt

Hints:
-The problem is that a tagService allows tag names using \n, see support2.get.js attached. Once \n is there it is written to a content property used by “TaggingServiceImpl”. “TaggingServiceImpl” expect lines having following structure: “tag name|count\n”. If tag name contains “\n” it is not the case any more, and it generates “java.lang.ArrayIndexOutOfBoundsException”.

-Would it not be better to trigger an exception when “addTag(tagname)” is called with a “tagname” containing “\n”. By doing so it would prevent the problem to occur.


Generated at Fri Dec 04 05:29:44 GMT 2020 using Jira 7.13.15#713015-sha1:7c5ddd2c3e1709974ae9c48c17df8edd3919fe2c.