在 Plone 的 full_review_list 中仅显示用户当前语言的项目 > 4.0.7
最近更改(链接到 Google 缓存,因为 dporg 现在似乎已关闭)Plone 计算 full_review_list
视图的评论列表的方式。为了更好地支持 LinguaPlone,WorkflowTool 现在显式添加 Language='all'
到用于检索工作列表的查询,而之前仅显示用户当前语言的结果。代码位于 Products.CMFPlone.WorkflowTool#getWorklistsResults()
中。
是否可以覆盖这个新行为以获得旧行为?
A recent change (link to Google Cache as d.p.org seems to be down right now) to the way Plone calculates the review list for the full_review_list
view. In order to support LinguaPlone better, WorkflowTool now explicitly adds a Language='all'
to the query used to retrieve a worklist, whereas before only results in the user's current language were shown. The code is in Products.CMFPlone.WorkflowTool#getWorklistsResults()
.
Is it possible to override this new behaviour to obtain the old behaviour?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们确实应该通过 ZCML 覆盖来定制它,但你是对的,在这种形式下它不是简单的可覆盖的。因此,无论您要采用哪种方法,都必须复制该方法并在其他地方修改它,然后将其挂接,以便您的自定义版本优先。
您需要在哪里查看更改?就在初始审查列表 portlet 中?在这种情况下,只需覆盖 渲染器 对于该 portlet,添加一种新渲染器的方法,复制代码,进行更改,然后重写渲染器以使用渲染器方法而不是 Portal_workflow 上的方法。
如果您想查看从 portlet 单击进入的完整审阅列表中的更改,则必须使用 collective.monkeypatcher 来修补portal_workflow上的方法。我建议不要这样做,因为您可能希望用户可以在某个地方查看所有语言的完整评论列表。
We really ought to make that customizable via a ZCML override, but you're right, in that form it's not overridable simply. So no matter what approach you're going to take, you'll have to copy that method and modify it somewhere else and then hook it in so that your customized version takes precedence.
Where do you need to see the changes? Just in the initial review list portlet? In that case, just override the renderer for that portlet, add a method to the new renderer, copy in the code, make your changes, then override the renderer to use the renderer method instead of the one on portal_workflow.
If you want to see the changes in the full review list you click through to from the portlet, then you'll have to use collective.monkeypatcher to patch the method on portal_workflow. I'd recommend against this, since you probably want someplace where users can go to see the full review list with all languages.