Opened 9 years ago

Closed 4 years ago

#1659 closed defect (wontfix)

prevent duplicate entries in the ctxtnav

Reported by: kckrinke Owned by: coderanger
Priority: normal Component: CtxtnavAddPlugin
Severity: normal Keywords:
Cc: kckrinke Trac Release: 0.10


Not really sure if this is a major problem or not but with the ctxtnav plugin I've made for my personal site, I end up with duplicates in the nav menu. The following change prevents any duplicate entries.

Index: 0.10/ctxtnavadd/
--- ctxtnavadd/        (revision 21)
+++ ctxtnavadd/        (revision 22)
@@ -81,7 +81,10 @@
                         href, text = add
                         adds.append(Markup('<a href="%s">%s</a>'%(href,Markup.escape(text,False))))
         js = ""
+        added = []
         for add in adds:
-            js += "add_ctxtnav('%s');\n"%add
+            if add not in added:
+                js += "add_ctxtnav('%s');\n"%add
+                added.append( add )
         return """<script type="text/javascript">%s</script>"""%js

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by rjollos

  • Resolution set to wontfix
  • Status changed from new to closed

Plugin is deprecated.

Add Comment

Modify Ticket

as closed The owner will remain coderanger.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.