https://sitecore.stackexchange.com/questions/12407/controller-action-not-called-due-to-rendering-datasource-containing-query/12461#12461
The existing project is upgraded from Sitecore 8.0 to Sitecore 9.0u1. After that, I've observed that few renderings are not working. The root cause is, controller rendering datasource query.
If controller rendering datasource has query like "query:./ancestor-or-self::[@@templatename='AgentWebsite']//[@@templatename='Site Root']", then it is not hitting the controller action. If I remove the datasource query, it is hitting properly.
I observed below warning in log file.
2708 00:09:21 WARN 'query:./ancestor-or-self::[@@templatename='AgentWebsite']//[@@templatename='Site Root']' is not valid datasource for web or user does not have permissions to access.
Can we convert the above query to make it work on Sitecore 9?
2
+50
Your query isn't wrong. And you don't need to change it for 9.0.
You've not shared your configuration nor your stack traces or anything else that might help, but my best guess is this:
In your 8.0 solution, you had implemented Queryable Datasources. Out of the box, your query is not supported on either Sitecore 8 or Sitecore 9.
And then I assume, this has not been noticed in the upgrade process and has therefore not been moved across to your Sitecore 9 installation. Move it, and your query should work as before.
on a side note: It looks like your query is designed to get the Site Root item of the current site you are on. There are far better ways of doing that, than via Sitecore Query. Just saying :-)
No comments:
Post a Comment