[MGNLRES-261] Resources app: AdminCentral UI interface crashes upon attempt to expand/collapse a deleted folder Created: 26/Feb/16 Updated: 29/Mar/22 Resolved: 09/Aug/16 |
|
| Status: | Closed |
| Project: | Magnolia Resources Module |
| Component/s: | None |
| Affects Version/s: | 2.4.3 |
| Fix Version/s: | 2.4.7, 2.5 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Aleksandr Pchelintcev | Assignee: | Sang Ngo Huu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 4d 7h | ||
| Original Estimate: | 3d | ||
| 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: | |||||||||
| Epic Link: | Resource reloading without restart | ||||||||
| Sprint: | Saigon 56 | ||||||||
| Story Points: | 8 | ||||||||
| Team: | |||||||||
| Description |
| Comments |
| Comment by Sang Ngo Huu [ 27/Jul/16 ] |
|
Hi apchelintcev, I saw that info.magnolia.resources.app.workbench.ResourcesContainer#getParent throws throw new IllegalArgumentException("Attempted to resolve the parent resource item id of non-existing (possibly removed) resource", e);, It will crash Vaadin on getDepth() function. So, there is my solution:
@Override
public void setCollapsed(Object itemId, boolean collapsed) {
try {
if (!collapsed) {
doExpand(itemId);
} else {
doCollapse(itemId);
}
} catch (Exception e) {
log.warn("Item {} is removed or deleted!", e);
}
}
origin.registerResourceChangeHandler(new ResourceChangeHandler() {
@Override
public void onResourceChanged(ResourceOriginChange change) {
refresh();
}
});
I'm still fixing Unitest, I don't know why JcrResourceOriginFactory and LayeredResourceOriginFactory is not generated, it caused missing class issue. Please let me know your ideas if any. Thanks, |
| Comment by Aleksandr Pchelintcev [ 27/Jul/16 ] |
|
sang.ngo yes, clearly throwing such an exception was like calling for unnecessary trouble. I think your solution is a good way to go. Could you pls create a PR, so it's easier to follow and judge about it? |