#13033 closed defect (fixed)
TypeError: pages() takes exactly 2 arguments (1 given)
Reported by: | Massimo | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | FieldTooltipPlugin |
Severity: | blocker | Keywords: | |
Cc: | Trac Release: | 1.2 |
Description
Since update to Trac 1.2 I get the following error with the latest revision of FieldToolTip:
Trac detected an internal error: TypeError: pages() takes exactly 2 arguments (1 given)
2017-01-09 09:16:57,747 Trac[main] ERROR: Internal Server Error: <RequestWithSession "GET '/ticket/271'">, referrer 'http://project-pq/trac-pqp/ticket/271' Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 613, in _dispatch_request dispatcher.dispatch(req) File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 273, in dispatch iterable=chrome.use_chunked_encoding) File "/usr/lib64/python2.7/site-packages/trac/web/chrome.py", line 1159, in render_template encoding='utf-8') File "/usr/lib64/python2.7/site-packages/genshi/core.py", line 184, in render return encode(generator, method=method, encoding=encoding, out=out) File "/usr/lib64/python2.7/site-packages/genshi/output.py", line 58, in encode for chunk in iterator: File "/usr/lib64/python2.7/site-packages/genshi/output.py", line 350, in __call__ for kind, data, pos in stream: File "/usr/lib64/python2.7/site-packages/genshi/output.py", line 829, in __call__ for kind, data, pos in stream: File "/usr/lib64/python2.7/site-packages/genshi/output.py", line 669, in __call__ for kind, data, pos in stream: File "/usr/lib64/python2.7/site-packages/genshi/output.py", line 774, in __call__ for kind, data, pos in chain(stream, [(None, None, None)]): File "/usr/lib64/python2.7/site-packages/genshi/output.py", line 594, in __call__ for ev in stream: File "/usr/lib64/python2.7/site-packages/genshi/core.py", line 289, in _ensure for event in stream: File "/usr/lib64/python2.7/site-packages/genshi/core.py", line 289, in _ensure for event in stream: File "/usr/lib64/python2.7/site-packages/trac/web/chrome.py", line 1426, in _strip_accesskeys for kind, data, pos in stream: File "/usr/lib64/python2.7/site-packages/genshi/core.py", line 289, in _ensure for event in stream: File "/usr/lib64/python2.7/site-packages/trac/web/chrome.py", line 1415, in _generate for kind, data, pos in stream: File "/usr/lib64/python2.7/site-packages/genshi/core.py", line 289, in _ensure for event in stream: File "/usr/lib64/python2.7/site-packages/genshi/core.py", line 289, in _ensure for event in stream: File "/usr/lib64/python2.7/site-packages/genshi/filters/transform.py", line 706, in _unmark for mark, event in stream: File "/usr/lib64/python2.7/site-packages/genshi/filters/transform.py", line 1168, in __call__ for mark, event in stream: File "/usr/lib64/python2.7/site-packages/genshi/filters/transform.py", line 746, in __call__ mark, subevent = next() File "/usr/lib64/python2.7/site-packages/genshi/filters/transform.py", line 702, in _mark for event in stream: File "/usr/lib64/python2.7/site-packages/genshi/core.py", line 289, in _ensure for event in stream: File "/usr/lib64/python2.7/site-packages/genshi/filters/transform.py", line 706, in _unmark for mark, event in stream: File "/usr/lib64/python2.7/site-packages/genshi/filters/transform.py", line 1076, in __call__ for mark, event in stream: File "/usr/lib64/python2.7/site-packages/genshi/filters/transform.py", line 118, in __iter__ event = self.stream.next() File "/usr/lib64/python2.7/site-packages/genshi/filters/transform.py", line 734, in __call__ for mark, event in stream: File "/usr/lib64/python2.7/site-packages/genshi/filters/transform.py", line 702, in _mark for event in stream: File "/usr/lib64/python2.7/site-packages/genshi/core.py", line 289, in _ensure for event in stream: File "build/bdist.linux-x86_64/egg/fieldtooltip/fieldtooltip.py", line 194, in __call__ data = self._add_title(data, 'th', 'id', 'h_', after_stream, depth) File "build/bdist.linux-x86_64/egg/fieldtooltip/fieldtooltip.py", line 227, in _add_title text = self.parent.pages.get(attr_value_locale, File "/usr/lib64/python2.7/site-packages/trac/cache.py", line 73, in __get__ return CacheManager(instance.env).get(id, self.retriever, instance) File "/usr/lib64/python2.7/site-packages/trac/cache.py", line 242, in get data = retriever(instance) TypeError: pages() takes exactly 2 arguments (1 given)
Attachments (1)
Change History (18)
comment:1 Changed 7 years ago by
comment:2 Changed 7 years ago by
I tried that patch. /newticket loads without error now, but tooltips are not working.
Changed 7 years ago by
Attachment: | t13033.patch added |
---|
comment:4 Changed 7 years ago by
The patch could probably be made backward-compatible with Trac 0.12 by using def pages(self, db=None):
and testing the arity of WikiPage.__init__
before deciding whether to pass the db
argument. Let me know if you'd like me to rework the patch to incorporate those changes.
comment:5 Changed 7 years ago by
Owner: | changed from matobaa to Ryan J Ollos |
---|---|
Status: | new → accepted |
Okay, I tested with 0.12, 1.0 and 1.2. I will commit, which I hope is okay.
comment:7 follow-up: 10 Changed 7 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I have built r16405, but I can't see any Tooltips eventhough I still have the old wikis for the tooltips.
The only tooltip is on the Cc input field but this looks different from the FieldTooltipPlugin. Where is this one defined?
comment:8 Changed 7 years ago by
According to /about it is loaded:
FieldTooltip 0.7 /mnt/data/trac/projects/trac-ppp/plugins/FieldTooltip-0.7-py2.7.egg
I don't see an error in the log.
comment:9 follow-up: 11 Changed 7 years ago by
Do a hard refresh of the page and then check the browser console.
comment:10 Changed 7 years ago by
Replying to Massimo:
The only tooltip is on the Cc input field but this looks different from the FieldTooltipPlugin. Where is this one defined?
If you haven't defined help/cc
: fieldtooltipplugin/0.12/fieldtooltip/fieldtooltip.py@16423:39#L26.
comment:11 Changed 7 years ago by
Replying to Ryan J Ollos:
Do a hard refresh of the page and then check the browser console.
14:20:41.799 TypeError: a.browser is undefined1 jquery.tools.min.js:11:629 This browser is Palemoon-27.2.1 on Linux amd64 arch.
comment:12 Changed 7 years ago by
The plugin uses jQuery migrate now, and you should see a message on the console indicating this. From the error message it looks like the library isn't loaded in your browser. You may need to redeploy static resources.
comment:14 follow-up: 17 Changed 7 years ago by
comment:8 issue should be fixed in r16427, but comment:12 still applies.
comment:16 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:17 Changed 7 years ago by
Replying to Ryan J Ollos:
comment:8 issue should be fixed in r16427, but comment:12 still applies.
Fixed and working. Thanks.
You'll probably need to remove the
db
argument from pages. For backward compatibility you could try usingdb=None
and removing the optionaldb
argument fromWikiPage
: fieldtooltipplugin/0.12/fieldtooltip/fieldtooltip.py@14215:99,101#L94.Untested patch:
0.12/fieldtooltip/fieldtooltip.py
):, db=db).textOr you could just make a new branch for Trac 1.2 and drop both
db
arguments.