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

umbraco/backoffice/relationseditor/relations/isallowedentity 404 on add relation from search #21

Open
niallmccabe opened this issue Mar 22, 2018 · 4 comments

Comments

@niallmccabe
Copy link

When trying to add a relation from search, this error is thrown. It looks like the treeAlias property is undefined.
image
There is also a console error Cannot get a descendant node from a section container node without a treeAlias specified. Is there a fix for this issue?

@lars-erik
Copy link
Owner

Thanks,

What versions are you on of Umbraco and Relation Editor?
Did you install RE from Nuget?

@niallmccabe
Copy link
Author

Umbraco version is 7.9.2 and RelationEditor package version is 1.2.3
It was installed from Nuget.

I have found, just testing locally, that setting treeAlias to $scope.resourceSets[index].ChildType.Section as opposed to $scope.resourceSets[index].ChildType.TreeType (Ln 78) or entity.metaData.treeAlias (Ln 58) in $scope.pickRelation in the relationeditor.js file, that appears to fix it.

Although I'm unsure if that is the correct way to go about fixing it, I am unsure about where treeAlias is supposed to be set. I can say it appears to work.

@niallmccabe
Copy link
Author

@lars-erik I might attempt a fix and submit a PR, if you are happy enough with that. I would need to know if my assumption on the treeAlias value matching the section is correct. I have found it to work in my testing, if that helps.

@met67
Copy link

met67 commented Jul 12, 2018

I had the same problem (Umbraco 7.10.4 and also 7.11.1), solved by changing line 58 in relationeditor.js from:

entity.metaData.treeAlias,

to:

entity.metaData.treeAlias || $scope.resourceSets[index].ChildType.TreeType || $scope.resourceSets[index].ChildType.Section,

but I guess it is more a hack than a solution.

Seems that the treePicker() dialog passes the searchSelected() callback an entity with a null metaData.treeAlias, don't know why.

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

3 participants