[BLOSSOM-231] Blossom seems to have no location in metadata Created: 13/Apr/16  Updated: 29/Jun/18  Resolved: 29/Apr/16

Status: Closed
Project: Blossom
Component/s: None
Affects Version/s: None
Fix Version/s: 3.1.3

Type: Bug Priority: Critical
Reporter: Samuel Zihlmann Assignee: Tobias Mattsson
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Nullpointer1.png    
Issue Links:
Cloners
relation
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:
Visible to:
Peter Mohn

 Description   

The Config-App feature Download as YAML does not work in combination with blossom module.
There is a bug in info.magnolia.ui.framework.availability.IsDefinitionRule:

@SuppressWarnings("unchecked")
private boolean hasDefinitionFor(String nodePath) {
	// We're doing this stuff in a sub-optimal way unless the issue MAGNOLIA-6086 is fixed
	for (Registry registry : registries) {
		Collection<DefinitionProvider> providers = registry.getAllProviders();
		for (DefinitionProvider provider : providers) {
			if (provider.getMetadata().getLocation().equals(nodePath)) {
				return true;
			}
		}
	}
	return false;
}

DefinitionProviders (@Template) registered by blossom seems to have no location in metadata, which leads to a NullpointerException in hasDefinitionFor method.



 Comments   
Comment by Tobias Mattsson [ 22/Apr/16 ]

I believe it correct that blossom templates not have a location. The method that NPEs tests if a template is from a certain node path, blossom templates are not from nodes at all so the method should return false for these. A null-check on location would solve that.

Comment by Samuel Zihlmann [ 22/Apr/16 ]

That's correct. I don't no why support created a blossom issue out of this
I think my description was clear, IsDefinitionRule need some fixes. Thank you.

Comment by Tobias Mattsson [ 22/Apr/16 ]

The value set in the location property is dependent of the source from where the definition was loaded. It has no defined format that it needs to conform to. In the case of Blossom it makes sense to use the class name. For dialogs being created by an annotated method it should be the class name followed by a period and then the name of the method.

Generated at Sun Feb 11 23:31:27 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.