Sitecore: The layout for the requested document was not found

杀马特。学长 韩版系。学妹 提交于 2020-01-14 05:10:08

问题


Only when I go to preview an item from the Content editor I get an error message

The layout for the requested document was not found.

I get redirected to

http:///?item=%2f&layout=%7b00000000-0000-0000-0000-000000000000%7d&device=Default

However, if I take the url and type it in directly or cut and paste like

http:///?sc_itemid=%7BDA4BABB2-2605-46C5-8BA6-52215A826154%7D&sc_mode=preview&sc_lang=en

Preview works.

If I load the previous backup it works, I am trying to figure out the difference between the two databases.

Any ideas of where to being to look.

Update I am using Sitecore.NET 7.5 (rev. 150212)

The issue seems to be with the Master Database, since I can use the current Core and Web database with the previous Master database and it works

The log shows

8360 07:23:12 WARN  Could not find type in ReflectionUtil.CreateObject: Sitecore.Shell.Applications.Analytics.VisitorIdentifications.RunVisitorIdentifications
8360 07:23:12 ERROR Could not instantiate "Sitecore.Shell.Applications.Analytics.VisitorIdentifications.RunVisitorIdentifications,Sitecore.Client" command object.
8360 07:23:12 WARN  Could not find type in ReflectionUtil.CreateObject: Sitecore.Shell.Applications.Analytics.Reports.Summary.Update
8360 07:23:12 ERROR Could not instantiate "Sitecore.Shell.Applications.Analytics.Reports.Summary.Update,Sitecore.Client" command object.
1932 07:23:17 INFO  Cache created: 'WebUtil.QueryStringCache' (max size: 19KB, running total: 807MB)
9780 07:23:24 INFO  HttpModule is being initialized
12800 07:23:24 INFO  HttpModule is being initialized
6248 07:23:25 INFO  HttpModule is being initialized
13332 07:23:46 ERROR Item could not be found from query string. [ID is "{DA4BABB2-2605-46C5-8BA6-52215A826154}".]

回答1:


If you've only switched out the database it would imply that Sitecore is expecting files that do not exist in your solution.

Check the layout path on the layout definitions in the content editor to make sure that the layouts being referenced actually exist.

I would also check if everything is published correctly over to the web database as you may not be seeing the full picture.

Also please provide any error messages from the log file.

If none of these options changes anything then it points towards being an issue with the preview which could mean the site node is not confiured correctly in the Web.config




回答2:


Thank you all for your help, but for this particular issue this was the fix

Annoying Misconfiguration

Excerpt

The config entry for the url being browsed had the attribute domain="extranet" in it. Reading around on the internet, when you click the Preview button, Sitecore tries to load the item you selected using the “\anonymous” account – where is the value of the domain attribute from your configuration.

So in this case, Sitecore was trying to run the preview as “extranet\anonymous” – which is exactly the security right that we have denied by clicking “Require Login”:

So the log error really means “I can’t load that item because access is denied”. For reasons best known to themselves, the developers who wrote this bit of code seem to have decided that if you can’t load an item you should fall back to the homepage item instead of warning the user what’s happened.

Changing the domain attribute’s value to the correct “sitecore” security domain (the one which editorial accounts live in) fixes the issue.




回答3:


I had a similar issue, and my website was correctly showing on my content management server, but it was getting the same layout error on the content delivery server. As Ian Graham pointed out, you need to make sure that you publish your site.

When I was looking at the web database my website wasn't referencing any of my layout templates. After publishing on my core database, that solved the issue.



来源:https://stackoverflow.com/questions/30537015/sitecore-the-layout-for-the-requested-document-was-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!