[MGNLDAM-481] JcrAssetProvider#getRootFolder throws an IllegalArgumentException Created: 11/Jul/14  Updated: 29/Jul/14  Resolved: 15/Jul/14

Status: Closed
Project: Magnolia DAM Module
Component/s: DAM JCR Provider
Affects Version/s: 2.0
Fix Version/s: 2.0.2

Type: Bug Priority: Major
Reporter: Marcus Büttner Assignee: Eric Hechinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLDAM-494 DamTemplatingFunctions#getAssetForAbs... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

JcrAssetProvider#getRootFolder resolves the root folder with getFolder("/"). The getFolder method fetches the folder relative to the root folder via getNodeByPath(folder).

Session#getNode(getRootPath()).getNode(relPath)



 Comments   
Comment by Marcus Büttner [ 17/Jul/14 ]

Hi,

JcrAssetProvider#getItem(path) where path is "/" (root) wouldn't work anyway with these fix.

regards,
Marcus

Comment by Eric Hechinger [ 17/Jul/14 ]

Hi Marcus

Thanks for the input, I missed a case...
Just remember that base on the javadoc of JcrAssetProvider#getNodeByPath(path) used by the implemented method of PathAwareAssetProvider, the input parameter is a relative path to the root path.
If you want to have the root node just send an empty path (this was the missing case).
see JcrAssetProviderRepositoryTest#getItemByPath...

Regards
Eric

Comment by Marcus Büttner [ 17/Jul/14 ]

Hi Eric,

you're right.
Thanks!

Regards
Marcus

Comment by Tomáš Gregovský [ 24/Jul/14 ]

Good to hear that it is already fixed since this issue is relevant to all info.magnolia.dam.templating.functions.DamTemplatingFunctions.getAssetForPath and info.magnolia.dam.templating.functions.DamTemplatingFunctions.getAssetForAbsolutePath as well.

Generated at Mon Feb 12 05:00:16 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.