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

Replace XPath queries #12

Merged
merged 2 commits into from Nov 19, 2021
Merged

Replace XPath queries #12

merged 2 commits into from Nov 19, 2021

Conversation

bjarnef
Copy link
Contributor

@bjarnef bjarnef commented Oct 3, 2021

Depending on the content structure we can look for a settings node at root, under home node or deeper in structure.
Alternatively we could also use Descendant() method, DescendantOfType() or FirstChildOfType().

Fixes #9

@idseefeld
Copy link
Collaborator

@bjarnef Hi Bjarne, I have just tried this patch and found two issues:

  1. I had to add using Umbraco.Extensions; to fix home?.FirstChild(... in line 18
  2. The tests for SiteSettings do not pass. Probably because MockContentQueryXPAth is used 🤔

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 7, 2021

@idseefeld yes, you're are right. The namespace Umbraco.Extensions was missing. Fixed in d439fae

Not sure about the test for SiteSettings though.

@Adolfi Adolfi merged commit f9d644e into Adolfi:master Nov 19, 2021
@Adolfi
Copy link
Owner

Adolfi commented Nov 19, 2021

Merged and fixed failing tests. Thanks @bjarnef !!

@bjarnef bjarnef deleted the patch-1 branch November 19, 2021 16:30
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

Successfully merging this pull request may close these issues.

Replace ContentAtXPath
3 participants