Ticket #8638 (assigned defect)

Opened 2 years ago

Last modified 1 year ago

[PATCH] TagsPlugin should implement wiki_page_renamed method of IWikiChangeListener interface

Reported by: itamarost Assigned to: hasienda (accepted)
Priority: normal Component: TagsPlugin
Severity: normal Keywords: wiki rename IWikiChangeListener
Cc: rjollos, otaku42 Trac Release: 0.12

Description

Starting Trac 0.12 the WikiRename? functionality is available in core, and notifies plugins about page renaming via the wiki_page_renamed() method of the IWikiChangeListener interface.

TagsPlugin should implement this API in order to move tags from old_page to page when a rename is performed.

Attachments

wiki_rename-0.6.patch (2.4 kB) - added by anonymous on 06/19/11 22:07:08.
Patch again 0.6 tag to make wiki_page_renamed work.
wiki_rename-trunk.patch (2.5 kB) - added by anonymous on 06/19/11 22:08:27.
Patch against trunk to make wiki_page_renamed work.

Change History

06/19/11 22:07:08 changed by anonymous

  • attachment wiki_rename-0.6.patch added.

Patch again 0.6 tag to make wiki_page_renamed work.

06/19/11 22:08:27 changed by anonymous

  • attachment wiki_rename-trunk.patch added.

Patch against trunk to make wiki_page_renamed work.

06/19/11 22:25:55 changed by sika

  • summary changed from TagsPlugin should implement wiki_page_renamed method of IWikiChangeListener interface to [PATCH] TagsPlugin should implement wiki_page_renamed method of IWikiChangeListener interface.

Included patches against 0.6 tag and trunk to make tags update accordingly after wiki page rename.

To patch your tagsplugin first apply the patch from comment 5 of ticket 5345 or you will get an error trying to upgrade your existing installation. Then apply the patch normally, e.g.

$ svn co http://trac-hacks.org/svn/tagsplugin/tags/0.6 tagsplugin-0.6
$ cd tagsplugin-0.6
$ patch -p0 < ../wiki_rename-0.6.patch
$ python setup.py bdist_egg
$ cp dist/*.egg /path/to/projenv/plugins

07/05/11 23:53:26 changed by hasienda

  • keywords changed from wiki rename to wiki rename IWikiChangeListener.
  • type changed from defect to enhancement.

#8670 has been closed as a duplicate of this ticket.

BTW, why should a missing new functionality for a 0.11 plugin with "works with 0.12 too" be considered as a bug? If it was explicitly designed for Trac 0.12, in fact it isn't, so please be reasonable.

Nevertheless the hint and patches are highly appreciated and should go into the repo soon. Thank you for your the effort put into this.

09/01/11 23:21:24 changed by hasienda

(In [10632]) TagsPlugin: Implement IWikiChangeListener interface for Trac 0.12, refs #8638 and #9059.

This work is based on code contributed/tested by Itamar Ostricher and sika.

Had a hard time myself to understand the consequences of wiki rename in Trac 0.12 i.e. for attachments, but now I favor this approach, even regarding naming conventions.

So I preferred reparent_resource_tags over rename_resource because the former is what we actually do while the latter has already been done, when IWikiChangeListener method wiki_page_renamed is triggered. Other details regarding the latest patch by Itamar have been discussed in #9059 before.

09/01/11 23:23:42 changed by hasienda

  • status changed from new to assigned.
  • cc set to rjollos, otaku42.
  • owner changed from otaku42 to hasienda.

No more removing and re-adding tags to wiki pages before/after move. Enjoy, and tell me, how it goes for you.

09/03/11 13:24:49 changed by hasienda

(In [10636]) TagsPlugin: A spurious self argument slipped in into changeset [10632], refs #8638 and #9059.

As outlined by Odd (osimons) in comment 4 of #9059 the usual first argument self is omitted from Interface definitions intentionally; cite:

Interface class declarations in Trac (and plugins) are always defined without adding self to the template methods. It has no real functional meaning, other than established practice to specify the essence of the API without implementation details + prevent that someone by accident makes an instance of the Interface class and tries to call it (if so it should fail).

12/23/11 11:11:38 changed by anonymous

  • type changed from enhancement to defect.

Not sure if this is connected, but I get a

Oops… Trac detected an internal error: AttributeError?: 'TagSystem?' object has no attribute 'reparent_resource_tags'

when trying to rename a wiki page

Trac 0.12.2 TracTags 0.7dev-r10639

(follow-up: ↓ 8 ) 12/23/11 17:34:34 changed by anonymous

ok, current r11061 seems to work. Thanks for the work guys.

(in reply to: ↑ 7 ) 12/24/11 07:14:57 changed by hasienda

Replying to anonymous:

ok, current r11061 seems to work. Thanks for the work guys.

Thanks, your issue was related indeed. And thank you too for the ok-report afterwards, especially, because anonymous have a tendency to only report bugs, and often they never come back again to respond/report on progress.

04/27/12 22:11:05 changed by dkgdkg

We just ran into this problem with an older version of trac-tags, and i can confirm that updating to the current svn resolved the problem for us.

Thanks for this work. I've submitted a new SVN snapshot to debian's unstable as well, fwiw.

05/15/12 21:16:03 changed by hasienda

Great new for a long-time Debian fellow. :-)


Add/Change #8638 ([PATCH] TagsPlugin should implement wiki_page_renamed method of IWikiChangeListener interface)




Change Properties
Action