Uploaded image for project: 'Magnolia DAM Module'
  1. Magnolia DAM Module
  2. MGNLDAM-567

JcrAssetProvider not I18n-aware

XMLWordPrintable

      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

        Acceptance criteria

              ajuran AntonĂ­n Juran
              vivi Vivian Steller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - 1h
                    1h
                    Remaining:
                    Remaining Estimate - 1h
                    1h
                    Logged:
                    Time Spent - Not Specified
                    Not Specified