#1347 closed enhancement (duplicate)
For each wanted page list the page on which it is referenced
Reported by: | Owned by: | Justin Francis | |
---|---|---|---|
Priority: | normal | Component: | WantedPagesMacro |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
Each item in the wanted pages list is a wiki term that does not yet have a page. I thought it would be nice to list the page or pages on which that term is used. This makes it much easier to go back and review the use of the term before creating the page. In some cases the term shouldn't really be a wiki term so this helps you find those mistaken terms and escape them with the '!' prefix.
Here is the patch:
Index: wanted_pages/wanted_pages.py =================================================================== --- wanted_pages/wanted_pages.py (revision 2103) +++ wanted_pages/wanted_pages.py (working copy) @@ -49,9 +49,16 @@
pages = self.findBrokenLinks(texts, req).values()
wikiList =
+ referers =
pages.sort() for page in pages:
- wikiList += (' * %s\n' % page)
+ referers = + db = self.env.get_db_cnx() + cursor = db.cursor() + cursor.execute("select name n from wiki where text like '%" + page + "%' and version = (select max(version) from wiki where name = n)") + for (name) in cursor: + referers += (' %s? ' % name) + wikiList += " * " + page + " (" + referers + ")\n"
return wiki_to_html(wikiList, self.env, req)
Attachments (0)
Change History (2)
comment:1 Changed 18 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:2 Changed 11 years ago by
Component: | WantedPagesPlugin → WantedPagesMacro |
---|
Renaming plugin from WantedPagesPlugin to WantedPagesMacro.
Thanks for the patch. I have added it to #714 and marked this as a duplicate of that ticket.