[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Publisher/Browser - GlobalBrowserMenuService.py:1.7
Jim Fulton
jim@zope.com
Mon, 11 Nov 2002 15:20:27 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Publisher/Browser
In directory cvs.zope.org:/tmp/cvs-serv15305/Browser
Modified Files:
GlobalBrowserMenuService.py
Log Message:
Fixed a bug that allowed titles to be repeated when there are
overlapping menu item definitions. For example, a menu item defined for
an interface should *replace* definitions for base interfaces.
=== Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py 1.6 => 1.7 ===
--- Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py:1.6 Wed Nov 6 17:30:21 2002
+++ Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py Mon Nov 11 15:20:27 2002
@@ -60,9 +60,16 @@
traverser = PublicationTraverser()
result = []
+ seen = {}
for items in registry.getAllForObject(object):
for action, title, description, filter in items:
+
+ # Make sure we don't repeat a specification for a given title
+ if title in seen:
+ continue
+ seen[title] = 1
+
if filter is not None:
try: