[MGNLDAM-718] Class cast exception in getItem of AbstractAssetContainer Created: 26/Jul/17 Updated: 12/Mar/21 Resolved: 12/Mar/21 |
|
| Status: | Closed |
| Project: | Magnolia DAM Module |
| Component/s: | DAM External App |
| Affects Version/s: | 2.2.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Viet Nguyen | Assignee: | Unassigned |
| Resolution: | Obsolete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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
|
||||
| Date of First Response: | |||||
| Description |
|
Steps to reproduce extracted from comment of Panagiotis in SUPPORT-7697:
Issue at line 161 of info.magnolia.dam.external.app.contentview.AbstractAssetContainer.getItem(Object) 159 @Override 160 public BeanItem<info.magnolia.dam.api.Item> getItem(Object itemId) { 161 if (itemId != null && ItemKey.isValid(((ItemKey) itemId).asString())) { 162 try { 163 info.magnolia.dam.api.Item item = getAssetProvider().getItem((ItemKey) itemId); 163 info.magnolia.dam.api.Item item = getAssetProvider().getItem((ItemKey) itemId); 164 return new BeanItem<info.magnolia.dam.api.Item>(item); 165 } catch (AssetProvider.AssetNotFoundException e) { 166 log.error("Failed to retrieve item with given id: " + e.getMessage(), e); 167 } catch (AssetProvider.IllegalItemKeyException e) { 168 log.error("Failed to handle item id: " + e.getMessage(), e); 169 } 170 } 171 return null; 172 } |
| Comments |
| Comment by Viet Nguyen [ 26/Jul/17 ] |
|
We didn't catch all error cases even-though it does not happen frequently but absolutely it would help potential customers. |
| Comment by Marty Glaubitz [ 10/Jan/19 ] |
|
I hit the same issue. In my opinion it's a bug in the ListViewImpl in the Method select, line number 247 @Override public void select(List<Object> itemIds) { if (itemIds == null) { table.setValue(null); return; } // convert to set before comparing with actual table selection (which is also a set underneath) Set<Object> uniqueItemIds = new HashSet<>(itemIds); // source of the problem if (uniqueItemIds.equals(table.getValue())) { // selection already in sync, nothing to do return; } table.setValue(uniqueItemIds); // do not #setCurrentPageFirstItemId because AbstractJcrContainer's index resolution is super slow. } Solved it the same way @Viet Nguyen did |
| Comment by Roman Kovařík [ 12/Mar/21 ] |
|
Closing as DAM external app has been deprecated in favour of https://docs.magnolia-cms.com/product-docs/Connector-Packs/DAM-Connector-Pack.html#_seamless_integration_with_your_content |