Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicornSqlServerDataProvider: GetChildIDs and HasChildren are not costistent #382

Open
test-mfel opened this issue Mar 23, 2020 · 0 comments

Comments

@test-mfel
Copy link

test-mfel commented Mar 23, 2020

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Prerequisites:
Sitecore 9.3
Unicorn 4.1.1 (default setup after installing nuget package)
Ucommerce 8.4

Behaviour:
Sitecore Content tree doesnot show descendants.
(Extra information: I checked all previous posts for compatibility around UCommerceDataProvider and UnicornSqlServerDataProvider, GetChildIDs works as expected)
Descendants items are not shown in the content tree.

If the current behavior is a bug, please provide the steps to reproduce.
Default installation of Sitecore 9.3
Default installation of Ucommerce 8.4
Default installation of Unicorn 4.1.1

What is the expected behavior?
Default sitecore tree structure is visible and expandable.
That If item has descendants, the arrow is shown.
If I press to arrow, I see descendants

Technical details:

The method GetChildIDs makes a call to the base.GetChildIDs. (please see the picture in attachments: unicorn_native_GetChildIDs_implementation)
In my case UnicornDataProviders do not return any values when base.GetChildIDs returns.
(please check attachment: unicorn_returns_no_children)

HasChildren in current Unicorn Implementation only goes through the loop by UnicornDataProviders. And returns false.
This I found a bit inconsistent.

Currently, I made a new CustomDataProvider that has original sitecore implementation:

public override bool HasChildren(ItemDefinition itemDefinition, CallContext context)
{
var childIds = GetChildIDs(itemDefinition, context);
if (childIds != null)
return childIds.Count > 0;
return false;
}

By this behaviour I use the same GetChildIDs method that fix the inconsistency.
Could you please check that?

unicorn_returns_no_children
unicorn_content_tree_no_descendants_are_visible
unicorn_native_GetChildIDs_implementation

Please mention your Sitecore version and Unicorn version.
Default installation of Sitecore 9.3
Default installation of Ucommerce 8.4
Default installation of Unicorn 4.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant