Commit 4e165ea
Fix path comparison bug in UserStartNodeEntitiesService (similar to #21162)
This fixes the same path comparison bug we fixed in PR #21162 but in C# string
comparisons instead of SQL queries.
## Root Cause
Path comparisons without trailing commas caused false matches:
- Path "-1,1001" incorrectly matched prefix "-1,100"
- This marked nodes as ancestors/descendants when they weren't related
## Examples of False Matches
- child.Path = "-1,1001", startNodePath = "-1,100"
- OLD: "-1,1001".StartsWith("-1,100") = TRUE (bug!)
- NEW: "-1,1001,".StartsWith("-1,100,") = FALSE (correct!)
- child.Path = "-1,100", startNodePath = "-1,1001"
- OLD: "-1,1001".StartsWith("-1,100") = TRUE (bug!)
- NEW: "-1,1001,".StartsWith("-1,100,") = FALSE (correct!)
## Fix Applied (Two Locations)
1. Line 146 (ancestor check): Added comma suffix to child.Path
2. Line 226 (IsDescendantOrSelf): Added comma suffix to both paths
This matches the pattern already used correctly in lines 92 and 191 of the
same file, and mirrors the SQL fix from PR #21162.
## Test Impact
This should fix the failing E2E test where child media folders were incorrectly
marked as noAccess when they were actually the user's start node.
Related: #21162
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent a8f7837 commit 4e165ea
File tree
1 file changed
+5
-2
lines changed- src/Umbraco.Cms.Api.Management/Services/Entities
1 file changed
+5
-2
lines changedLines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
223 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
224 | 227 | | |
0 commit comments