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

Cannot delete duplicated asset

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 1.0
    • 1.0
    • None
    • None

    Description

      2013-06-13 16:18:27,925 ERROR info.magnolia.cms.core.version.BaseVersionManager : failed to copy versionable node to version store, reverting all changes made in this session
      2013-06-13 16:18:27,925 ERROR gnolia.ui.framework.action.MarkNodeAsDeletedAction: Could not execute command operation.
      info.magnolia.ui.api.action.ActionExecutionException: org.apache.commons.lang.exception.NestableException: Exception during executing command
      at info.magnolia.ui.framework.action.AbstractCommandAction.execute(AbstractCommandAction.java:167)

      This is due to the Reference property. Linking a Node using a reference involve integrity check (make a version of a Asset without having the original node already versioned will throw Integrity exception).

      Solution is to use Weak reference, that do not required integrity check.

      Strange is that the asset node type definition includes :
      <propertyDefinition name="master" requiredType="WeakReference" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" isFullTextSearchable="false" isQueryOrderable="false"/>

      but this is not taken into account when doing: workspace.copy(..

      We have to explicitly ask for a weak reference:
      Value refValue = copyNode.getSession().getValueFactory().createValue(originalNode, true);
      copyNode.setProperty(DamNodeTypes.Asset.MASTER, refValue);

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              ehechinger Eric Hechinger
              fgrilli Federico Grilli
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD