#8832 closed defect (fixed)
AttributeError: 'Context' object has no attribute 'has_tags'
Reported by: | lucid | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | DiscussionPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
After updating (Trac 12.2, DiscussionPlugin r9877) I get the following error when using the RecentTopics macro:
AttributeError: 'Context' object has no attribute 'has_tags' 2011-05-25 12:32:05,846 Trac[formatter] ERROR: Macro RecentTopics(10) failed: Traceback (most recent call last): File "build\bdist.win32\egg\trac\wiki\formatter.py", line 717, in _macro_formatter return macro.process(args, in_paragraph=True) File "build\bdist.win32\egg\trac\wiki\formatter.py", line 304, in process text = self.processor(text) File "build\bdist.win32\egg\trac\wiki\formatter.py", line 291, in _macro_processor text) File "build\bdist.win32\egg\tracdiscussion\wiki.py", line 81, in expand_macro return self._expand_recent_topics(formatter, name, content) File "build\bdist.win32\egg\tracdiscussion\wiki.py", line 233, in _expand_recent_topics forum_name = api.get_forum(context, entry['forum'])['name'] File "build\bdist.win32\egg\tracdiscussion\api.py", line 1622, in get_forum if context.has_tags: AttributeError: 'Context' object has no attribute 'has_tags'
Attachments (0)
Change History (9)
comment:1 Changed 13 years ago by
Status: | new → assigned |
---|
comment:2 Changed 13 years ago by
Ok thanks for the information. Is there a known stable / preferred latest version? It might be a good idea to mention this on the wiki page under PluginVersions?
comment:5 Changed 12 years ago by
Here is a small patch that fixes the issue, but I have no real idea if that's a smart one :
-
discussionplugin/0.11/tracdiscussion/wiki.py
diff -r ec2c58e517b9 discussionplugin/0.11/tracdiscussion/wiki.py
a b 120 120 121 121 # Get API component. 122 122 api = self.env[DiscussionApi] 123 124 # Get list of Trac users and availability of tags 125 context.users = api.get_users(context) 126 context.has_tags = api.env.is_component_enabled( 127 'tracdiscussion.tags.DiscussionTags') 128 123 129 124 130 # Get topic by subject 125 131 try: … … 175 181 # Get API object. 176 182 api = self.env[DiscussionApi] 177 183 178 # Get list of Trac users .184 # Get list of Trac users and availability of tags 179 185 context.users = api.get_users(context) 186 context.has_tags = api.env.is_component_enabled( 187 'tracdiscussion.tags.DiscussionTags') 180 188 181 189 # Parse macro arguments. 182 190 arguments = []
comment:6 Changed 12 years ago by
(In [12141]) Fixes #10461, Refs #8832: The components tracdiscussion.tags.DiscussionTags
and tractags.api.TagSystem
must be enabled in order for TagsPlugin support to be enabled. This is a workaround that will likely be improved on in #8832 as the tags module is redesigned.
comment:7 follow-up: 9 Changed 12 years ago by
Owner: | changed from Radek Bartoň to Ryan J Ollos |
---|---|
Status: | assigned → new |
The implementation of tags needs to be refactored/redesigned, but we can just fix this issue for now. Please report back if it is working after upgrading to the latest revision of the 0.11
branch.
comment:8 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:9 Changed 12 years ago by
Replying to rjollos:
The implementation of tags needs to be refactored/redesigned, but we can just fix this issue for now. Please report back if it is working after upgrading to the latest revision of the
0.11
branch.
Works well. Thanks.
Lastest revision is commit of unfinished work on TagPlugin support. Use some older revision for now.