Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.0.6
Description
Currently the JcrAssetProvider is not I18n-aware. Customers have to patch the respective class in projects in order to have multi-language support for assets.
The patch would be quite easy: in JcrAssetProvider, patch the method createAsset by wrapping the node with I18nNodeWrapper and that it:
@Override
Asset createAsset(final Node assetNode) {
if (AssetNodeTypes.isAsset(assetNode)) {
log.debug("Created asset linked to the following node '{}'", NodeUtil.getPathIfPossible(assetNode));
// FIXME PATCH START
// wrap asset node with i18n functionality
return new JcrAsset(this, new I18nNodeWrapper(assetNode));
// PATCH END
}
throw new IllegalArgumentException("Node '" + NodeUtil.getPathIfPossible(assetNode) + "' is not defining an asset but another item type");
}
A more sophisticated patch would ask I18nContent Support if I18n is enabled after all...
By the way, it would be helpful if that method was protected instead of package visible - but this is a general problem in Magnolia code... ![]()
This issue might also fix MGNLSTK-1404 in the same way?
Thanks for patching this soon ![]()
Checklists
Acceptance criteria
Attachments
Issue Links
- relates to
-
MGNLSTK-1404 STKAssetWrapper is not i18n aware
-
- Closed
-