adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
740 stars 747 forks source link

Title component NPE #791

Closed numirov closed 4 years ago

numirov commented 5 years ago

Bug Report

Current Behavior I have a proxy title component based on v2 title. I am overriding its dialog to hide linkUrl. I have custom banner component. Inside of it i am including title component: <div data-sly-resource="${'title' @ resourceType='mysite/components/content/title', decoration=true}" ></div> I also have parsys: <div data-sly-resource="${'par' @ resourceType='wcm/foundation/components/parsys', decoration=true}" ></div>

So i drag and drop banner component on a page. It already has title component inside of it. But when i try to open dialog of title it throws NPE.

IMG_20191010_112009

I guess it is because there is no title node, it is "synthetic" it will appear only when i configure and save it. But i cant do that because of npe. There is no null check after getResource call inside AllowedTitleSizesDataSourceServlet

Expected behavior/code Title component should be editable when included as data-sly-resource.

Environment

Possible Solution Check for null and if resource is null(synthetic) return some predefined allowed types

Additional context / Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.

archanasmsharma commented 5 years ago

I am also trying to use the Core component v2 directly in the HTL file of my component. <div data-sly-resource="${'title' @ resourceType='core/wcm/components/title/v1/title'}"></div> While trying to open the dialog, I get the same NPE

AustinPeter-ICF commented 4 years ago

I am also facing the same issue while trying to embed Title component. To add more context to the above issue. PFB screenshot FYI...

AEM Version : 6.5.2 Core Components Version : 2.7.0

Screen Shot 2019-10-21 at 4 26 39 PM
andreeadracea commented 4 years ago

The code for this issue is merged to master and will be available in the upcoming 2.8.0 release.