我想知道是否有其他人以前见过这个:
我有以下 ZCML:
<browser:page
for="*"
name="workflow_action"
class=".bika_listing.WorkflowAction"
permission="zope.Public"
/>
当我尝试访问 siteroot/workflow_action 时,Plone 告诉我“此页面似乎不存在......”
ZCML 正在被读取 - 如果我在ZCML,Plone无法启动。
我尝试过 for="Products.CMFPlone.interfaces.IPloneSiteRoot" 得到相同的结果。
WorkflowAction 中的代码根本没有被调用 - 如果我将 pdb 放入 __call__ 中,它不会触发。
我对不同的上下文有两个类似的 ZCML 定义,它们工作正常,看起来像这样:
<browser:page
for="bika.lims.interfaces.IAnalysisRequest"
name="workflow_action"
class=".analysisrequest.WorkflowAction"
permission="zope.Public"
/>
如果我删除这些其他视图,则系统中仅留下一个名称为“workflow_action”的视图(用于 IPloneSiteRoot 或“*”的视图) ,结果是一样的。
这看起来是一个非常简单的视图 - 我不知道我还可以在这里放置哪些其他信息?
使用克隆4.0.7。
一定是我!?
I wonder if anyone else has seen this before:
I have the following ZCML:
<browser:page
for="*"
name="workflow_action"
class=".bika_listing.WorkflowAction"
permission="zope.Public"
/>
When I try to visit siteroot/workflow_action, Plone tells me "This page does not seem to exist…"
The ZCML is being read - if I cause an error in the ZCML, Plone fails to start.
I've tried for="Products.CMFPlone.interfaces.IPloneSiteRoot" with the same result.
The code in WorkflowAction is not being invoked at all - if I place a pdb in __call__
, it does not fire.
I have two similar ZCML definitions for different contexts, which work fine and look something like this:
<browser:page
for="bika.lims.interfaces.IAnalysisRequest"
name="workflow_action"
class=".analysisrequest.WorkflowAction"
permission="zope.Public"
/>
If I remove these other views, leaving only one view in the system with name="workflow_action", (the one for IPloneSiteRoot or "*"), the result is the same.
This seems like a very simple view - I don't know what other information I can put here?
Using Plone 4.0.7.
it must be me!?
发布评论
评论(2)
您的浏览器视图很可能在 __init__() 方法中引发异常,因此该异常被忽略并且永远不会显示,结果通常是 404 错误。
Most likely your browserview raises an exception in the
__init__()
method and so the exception is ignored and never displayed, and the result usually is a 404 error.在 Private 状态文件夹上添加 Solgema.NavigationPortlet portlet 时,我遇到了类似的问题,然后我发现 navigation.py 中的 browser:page navTreeitem 引发了 KeyError,这导致客户端浏览器出现 404 响应。
感谢贾科莫的回答。
I have a similar issue when add a Solgema.NavigationPortlet portlet on a Private state folder, then I found the browser:page navTreeitem in navigation.py raised a KeyError, which cause a 404 response for client browser.
Thanks for Giacomo's answer.