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

XPath on Multinode Treepicker doesn't seem to work. #20

Closed
kasperskov909 opened this issue Feb 15, 2018 · 2 comments
Closed

XPath on Multinode Treepicker doesn't seem to work. #20

kasperskov909 opened this issue Feb 15, 2018 · 2 comments
Milestone

Comments

@kasperskov909
Copy link

kasperskov909 commented Feb 15, 2018

I've created a new data type using the multinode treepicker with a specific xpath in Umbraco 7.8 (cloud). The xpath mechanism works fine when used as a property on a document type but not as an editor/data type on a Fluidity field.

Xpath used in my case: $root//docTypeAlias1//docTypeAlias2

Note that the "Allow items of type" property on the Multinode Treepicker works fine in Fluidity.

@mattbrailsford
Copy link
Owner

Ok, so I've found the root of the cause, but not sure of the fix at the moment. It looks like MNTP calls entityResource.getByQuery which accepts the xpath but also requires a node id for context, which it is currently getting from the $routeParms.id property, which in a Fluidity context is something like collectionAlias!entityId. That's fine for us, but it looks like the getByQuery api expects that value to be an integer and so is throwing an error.

The only workaround I can think of atm would be to intercept calls to getByQuery and if id looks like a fluidity based id, then set it to -1, but I'm not sure how happy I am with doing that at the moment.

mattbrailsford added a commit that referenced this issue Mar 7, 2018
…ntityResource.getByQuery from within fluidity, setting the context node id to -1
@mattbrailsford
Copy link
Owner

Ok, in looking through the source, it seems I'm already doing some overriding in places so what does one more hurt :)

This issue is fixed in commit bb4c6c0. I've also added some notes to the known issues documentation as the only xpath statements that will be supported are those starting $root. All others require a content node context, which, not being in the content section means we can't provide.

@mattbrailsford mattbrailsford added this to the 1.0.2 milestone Mar 7, 2018
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

2 participants