[MGNLDAM-563] DublinCore metadata cannot be retrieved from an asset Created: 18/Mar/15 Updated: 19/Mar/18 Resolved: 23/Mar/17 |
|
| Status: | Closed |
| Project: | Magnolia DAM Module |
| Component/s: | None |
| Affects Version/s: | 2.1 |
| Fix Version/s: | 2.2.3 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Christopher Zimmermann | Assignee: | Hieu Nguyen Duc |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | metadata | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 4d 0.5h | ||
| Original Estimate: | 2d | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| 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
|
||||||||||||||||
| Release notes required: |
Yes
|
||||||||||||||||
| Date of First Response: | |||||||||||||||||
| Sprint: | Saigon 87, Saigon 88 | ||||||||||||||||
| Story Points: | 5 | ||||||||||||||||
| Description |
|
DamTemplatingFunctions.getAssetMap(asset) returns keys for the DC metadata but all of the values which should come from the asset are blank. To Reproduce - try the following Freemarker in a template:
[#assign assetMap = damfn.getAssetMap(asset).metadata.dc]
[#list assetMap?keys as prop]
${prop} = ${assetMap[prop]}<br>
[/#list]
This is because the asset app editor stores all the dc values in properties with no dc prefix, for example But in the JcrDublinCore class, the property names are named differently, they have a "dc_" prefix, for example: This is a bug introduced in DAM 2 in the JcrDublinCore class. In DAM 1.2.x the constants do not have the dc_ prefix. And tests also demonstrate that the properties should not have the prefix: |
| Comments |
| Comment by Magnolia International [ 19/Mar/15 ] |
|
A test should verify the functionality works in the first place (and thus demonstrate how it doesn't work before your fix) - you're saying it doesn't, which is likely, but at the same time, nothing tells us it does work now. |
| Comment by Hieu Nguyen Duc [ 14/Mar/17 ] |
|
I've tested this issue on https://demo.magnolia-cms.com/ and 5.5.3-SNAPSHOT and confirm that it's a bug. Steps to reproduce: 1) Enter all properties for /travel-demo/social-icons/google-plus.png in Assets app 2) In Resources app, add the below script to /travel-demo/templates/macros/imageResponsive.ftl after [ #if asset?exists ]
[#assign assetMap = damfn.getAssetMap(asset).metadata.dc]
[#list assetMap?keys as prop]
[#if assetMap[prop]?is_string]
${prop} = ${assetMap[prop]}<br>
[/#if]
[/#list]
3) Add a "Text and Image" component to /travel/about => The text shown on that page: coverage = identifier = jcr:52469758-3875-4ac1-b2bb-8deac5c8419b format = image/png description = test6 language = source = title = test3 type = relation = rights = test9 publisher = => All DC properties are empty. |
| Comment by Hieu Nguyen Duc [ 23/Mar/17 ] |
|
A hint for the release note. |