[MAGNOLIA-8536] Entering invalid characters in jcrName throws exception Created: 08/Jun/22 Updated: 08/Sep/22 Resolved: 05/Sep/22 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 6.2.19 |
| Fix Version/s: | 6.3.0, 6.2.24 |
| Type: | Bug | Priority: | Major |
| Reporter: | Markus Jeni | Assignee: | Adam Siska |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | VN-Analysis | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | 1d 2.5h | Time Spent: | 1d 2.5h |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Attachments: |
|
|||||||||||||||||||||||||||||||||||
| Issue Links: |
|
|||||||||||||||||||||||||||||||||||
| Sub-Tasks: |
|
|||||||||||||||||||||||||||||||||||
| Template: |
|
|||||||||||||||||||||||||||||||||||
| Acceptance criteria: |
[ ]*
do not allow (JCR) special characters
[ ] 
show validation error if name is invalid
[ ]*
no exceptions on invalid values
|
|||||||||||||||||||||||||||||||||||
| 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
|
|||||||||||||||||||||||||||||||||||
| Date of First Response: | ||||||||||||||||||||||||||||||||||||
| Epic Link: | Maintenance of vaadin8 framework | |||||||||||||||||||||||||||||||||||
| Sprint: | Nucleus 18 | |||||||||||||||||||||||||||||||||||
| Story Points: | 2 | |||||||||||||||||||||||||||||||||||
| Team: | ||||||||||||||||||||||||||||||||||||
| Description |
|
Entering special JCR internal characters in jcrName fields throws exception. This bug affects all apps and all node types. It can happen in every dialog/app where a jcrName field is included. Steps to reproduce
Result
This is just one way. All the same with assets, on folders, creating items, renaming items,... Expected behaviour
I propose to disallow any [] {} | : in JCR names because the can have a special meaning in some cases. Dev note having UTF8 support enabled is necessary to reproduce the issue |
| Comments |
| Comment by Markus Jeni [ 08/Jul/22 ] |
|
Examples for real page names editors could enter that lead to the exception:
|
| Comment by Quach Hao Thien [ 18/Jul/22 ] |
|
Discovery:
Possible solution:
REFs: |
| Comment by Dominik Maslanka [ 26/Jul/22 ] |
|
we will split this ticket into two parts (two tickets) 1. Add more invalid character '{ } |' to the check list (info.magnolia.jcr.util.NodeNameHelper#isCharValid) solve in this ticket 2. In the future we will display a more clear message to the user to prevent using such characters: MGNLUI-7384 |
| Comment by Roman Kovařík [ 27/Jul/22 ] |
|
Workaround: Configure pattern for nodeNameValidator. |
| Comment by Markus Jeni [ 19/Aug/22 ] |
|
Workaround does not work. See demoauthor:
|
| Comment by Roman Kovařík [ 19/Aug/22 ] |
|
Hey mjeni,
validators:
- $type: nodeNameValidator
mode: ADD
pattern: "[a-zA-Z0-9]*"
errorMessage: "Only [a-zA-Z0-9] allowed"
Roman |
| Comment by Markus Jeni [ 19/Aug/22 ] |
|
We are using this config now as a workaround because your pattern is too strict (we have some pages with UTF-8 names): pattern: "[^{}|]*" errorMessage: "Characters { } | are not allowed" |