-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
None
-
None
-
invesco.com
-
-
Empty show more show less
-
Basel 139
-
3
In SUPPORT-8497, there are few cases that 'upgraded to 5.6.3 from 5.6, "Definitions" app is not opening up and throwing an error in the back end, attached is the debug log for this action.'
The NPE caused by
{{ DefinitionMetadata metadata.getConfigurationSourceType().name() }}
Could be after migration, we lack of definition source type somewhere or customer has a custom implementation which didn't set any value to that field.
Error in
https://git.magnolia-cms.com/projects/MODULES/repos/definitions-app/browse/src/main/java/info/magnolia/definitions/app/problems/list/ProblemReportListPresenter.java#113
Fix by null checking such as
if (itemId instanceof DefinitionProviderId) { final DefinitionProviderId definitionProviderId = (DefinitionProviderId) itemId; final DefinitionMetadata metadata = definitionProviderId.getValue().getMetadata(); String type = metadata.getType() == null ? "unknown" : metadata.getType().getName(); String sourceType = metadata.getConfigurationSourceType() == null ? "unknown" : metadata.getConfigurationSourceType().name(); final Table.GeneratedRow generatedRow = new Table.GeneratedRow( String.format(definitionProviderInfoTemplate, definitionProviderId.getStyle(), type, metadata.getReferenceId(), sourceType, metadata.getLocation())); generatedRow.setSpanColumns(true); generatedRow.setHtmlContentAllowed(true); return generatedRow; }
-----------------------
Proposed solution:
- add a new 'unknown' source type to your enum and use it in case of missing source type.
- this issue is not a common issue and should not happen in a new, ideal environment, however we still able to support customers for custom code that lack of setting this info.
Acceptance criteria