Expand my Community achievements bar.

Resolving available components seems buggy...

Avatar

Level 2

Recently I've finally forced myself to initially polish and publish some code that possibly might be useful to the community. It's available here together with some preliminary wiki pages. To avoid creating my own frontend I've used some free samples from mobirise.com​. And during this work I've stumbled upon something that seems to me like an obvious bug from AEM 6.3. I'll illustrate it with links that assume localhost:4502 author is running with my project installed, but even without it the explanation will hopefully be clear enough.

I've got this component called pricing table​. It contains pricing items in its subresource named items. So we've got a structure like pricing-table/items/item_1​ so far. Now each pricing item also contains some so-called features under its own subresource. And here the issue reveals itself. Initially I've named the collection items as well. But with this naming not everything worked as expected, so currently in master branch I'm using the name features for the container. So the structure is like pricing-table/items/item_1/features/feature_1​. With this setup components available under pricing-table/items/item_1/features​​ are properly evaluated from the designs.

But as soon as I've switched the name from features to items inside a new branch bug/wrong-components-available​ - the problem manifests itself. Instead of using the definition of available components from pricing-table/items/item/items​ - AEM thinks they should come from pricing-table/items. Which is additionally weird considering the fact that some other features I'm using that are based on designs evaluate proper search path in this case. That suggests the issue lies within AEM frontend in the author clientlibs somewhere.

So yes - that's the problem. As you see I've fixed it with a workaround, but that's not a solution here. It's ok in this particular case, but I'd rather be not limited by AEM glitches in designing proper data structure. So I would hope some Adobe employees could take over here maybe?

2 Replies

Avatar

Employee Advisor

Are you using a parsys inside this pricing table, and another sub-parsys inside an item? In that case it might be that the design definitions for these parsyses are written wrong.

I know, that this approach of nested parsys instances is working (but from an UI perspective quite cumbersome to use).

Jörg

Avatar

Level 2

It's always possible that a developer made a mistake somewhere of course, but it's highly unlikely in this case for me I believe. I've created a script inside the parsys to render all the search paths in backend from ${currentStyle.cell.searchPaths} - you can check them easily at /content/mobirise/enigmatic/en/jcr:content/content/pricing-table/items/item_1/items.sp.html when on bug/wrong-components-available branch. It's showing a lot of them, but the important ones are in this order below:

...

page/content/pricing-table/items/item/items
page/content/pricing-table/items/item/parsys
page/content/pricing-table/parsys/item/items
page/content/pricing-table/parsys/item/parsys

...

page/content/pricing-table/items
page/content/pricing-table/parsys

...

As you see page/content/pricing-table/items/item/items comes way before page/content/pricing-table/items does. So the proper design configuration indeed does have a priority over the other one that actually gets picked at the end incorrectly. At least in the backend part of the system. That's why I strongly believe the frontend might have it wrong there. Where is the relevant js code located?

And again - when the last part of the path page/content/pricing-table/items/item/items is replaced by anything else like e.g. features - the correct designs will get picked...