[ http://jira.magnolia-cms.com/browse/MAGNOLIA-3288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vivian Steller updated MAGNOLIA-3288: ------------------------------------- Patch included: [Yes] Attachment: ContentVersion.java.patch added patch to fix the issue. The code overwritten methods in ContentVersion are just dump copies from the superclass DefaultContent, replacing the snippet: (1) this.node.getNode(name).isNodeType(ItemType.NT_RESOURCE) with (2) this.node.getNode(name).getProperty("jcr:frozenPrimaryType").getValue().getString().equals(ItemType.NT_RESOURCE) In (1) the node type is checked directly on the node. However, when it is a versioned content it is not sufficient to check the node type, since this one returns "jcr:frozenNode" for the versioned binary node data. The original node type is stored within the "jcr:frozenPrimaryType" node property, which correctly returns "mgnl:resource". > Retrieving a binary from versioned content fails > ------------------------------------------------ > > Key: MAGNOLIA-3288 > URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3288 > Project: Magnolia > Issue Type: Bug > Components: core > Affects Versions: 4.3.1, 4.3.6 > Reporter: Vivian Steller > Assignee: Ondřej Chytil > Priority: Critical > Attachments: ContentVersion.java.patch, ContentVersionTest.java.patch > > > Technically spoken it looks as if ContentVersion doesn't return any node data > of type binary. > Steps to reproduce (code): > 1. create a mgnl:contentNode called 'X' > 2. create a binary node data within X called 'B' > 3. call X.addVersion(rule) with a rule that accepts 'mgnl:resource' nodes > -> version gets created correctly, also containing the binary (use JCR query > tool to visualize the version node that you get when debugging > X.getContentVersion("1.0").getPath()) > 4. call X.getContentVersion("1.0").getNodeData('B').getValue() > -> returns null, expected was returning the binary value of node data B > Steps to reproduce (visually, just quoting philipp here, please ask him in > case of problems reproducing): > 1. login to a fresh mgnl 4.3.6 instance, go to DMS > 2. upload a document (binary, e.g. image), activate and evtl. accept the > activation in the inbox > -> creates a version of that document > 3. go to the version history of the newly created document and select the > previously created version > -> no data is displayed, expected was seeing the image you just versioned > Philipp mentioned there could be a bug in ContentVersion aka. the > ContentVersion$FixParentContentWrapper aka. ContentWrapper that fails to > retrieve the binary from a node in the version workspace. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.magnolia-cms.com/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <dev-list-unsubscr...@magnolia-cms.com> ----------------------------------------------------------------