#13179 closed defect (fixed)
Macro errors in combine use with WikiAutoCompletePlugin
Reported by: | ntmlod | Owned by: | Peter Suter |
---|---|---|---|
Priority: | normal | Component: | WikiAutoCompletePlugin |
Severity: | normal | Keywords: | autocomplete |
Cc: | Trac Release: | 1.0 |
Description
The macros crash when the plugin description is rendering inside the WikiAutoCompletePlugin popup.
2017-05-13 01:15:15,464 Trac[formatter] ERROR: Macro SiblingPage(None) failed: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 340, in _macro_processor text, self.args) File "build/bdist.linux-x86_64/egg/neighborpage/nav.py", line 74, in expand_macro prefix = '/' in page and page[:page.rindex('/') + 1] or '' TypeError: argument of type 'NoneType' is not iterable 2017-05-13 01:15:15,465 Trac[formatter] ERROR: Macro SiblingPage(Prev, Next) failed: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 340, in _macro_processor text, self.args) File "build/bdist.linux-x86_64/egg/neighborpage/nav.py", line 74, in expand_macro prefix = '/' in page and page[:page.rindex('/') + 1] or '' TypeError: argument of type 'NoneType' is not iterable 2017-05-13 01:15:15,466 Trac[formatter] ERROR: Macro PreviousPage(Prev, Next) failed: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 340, in _macro_processor text, self.args) File "build/bdist.linux-x86_64/egg/neighborpage/nav.py", line 74, in expand_macro prefix = '/' in page and page[:page.rindex('/') + 1] or '' TypeError: argument of type 'NoneType' is not iterable 2017-05-13 01:15:15,467 Trac[formatter] ERROR: Macro SiblingPage($PageName) failed: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 340, in _macro_processor text, self.args) File "build/bdist.linux-x86_64/egg/neighborpage/nav.py", line 74, in expand_macro prefix = '/' in page and page[:page.rindex('/') + 1] or '' TypeError: argument of type 'NoneType' is not iterable 2017-05-13 01:15:15,469 Trac[formatter] ERROR: Macro SiblingPage(Minutes($PageName)) failed: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 340, in _macro_processor text, self.args) File "build/bdist.linux-x86_64/egg/neighborpage/nav.py", line 74, in expand_macro prefix = '/' in page and page[:page.rindex('/') + 1] or '' TypeError: argument of type 'NoneType' is not iterable
Attachments (6)
Change History (34)
comment:1 Changed 8 years ago by
Keywords: | autocomplete added |
---|---|
Summary: | Macro errors used with → Macro errors in combine use with WikiAutoCompletePlugin |
Changed 8 years ago by
Attachment: | Screen Shot 2017-05-19 at 18.38.05.png added |
---|
Changed 8 years ago by
Attachment: | t13179.diff added |
---|
comment:2 Changed 8 years ago by
Component: | NeighborPagePlugin → WikiAutoCompletePlugin |
---|---|
Owner: | changed from matobaa to Peter Suter |
comment:6 follow-up: 22 Changed 8 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Thanks for the patch, I have updated both WikiAutoCompletePlugin and NeighborPagePlugin
There is improvement as WikiMacros local page doesn't show anymore the errors but I still get the same issues in the popup.
2017-05-24 15:20:24,905 Trac[formatter] ERROR: Macro SiblingPage(None) failed: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 340, in _macro_processor text, self.args) File "build/bdist.linux-x86_64/egg/neighborpage/nav.py", line 76, in expand_macro prefix = '/' in page and page[:page.rindex('/') + 1] or '' TypeError: argument of type 'NoneType' is not iterable 2017-05-24 15:20:24,908 Trac[formatter] ERROR: Macro PreviousPage(Prev, Next) failed: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 340, in _macro_processor text, self.args) File "build/bdist.linux-x86_64/egg/neighborpage/nav.py", line 76, in expand_macro prefix = '/' in page and page[:page.rindex('/') + 1] or '' TypeError: argument of type 'NoneType' is not iterable
comment:8 Changed 8 years ago by
I got the same result with 2 different sessions of Firefox (my admin session and user session).
I cleared the cache on both but not good another time.
comment:9 Changed 8 years ago by
Does the script at /chrome/wikiautocomplete/js/wikiautocomplete.js
match wikiautocompleteplugin/trunk/wikiautocomplete/htdocs/js/wikiautocomplete.js? It should have the changes: [16602#file1].
comment:10 Changed 8 years ago by
[xxxx@xxxxxxxxxx wikiautocompleteplugin]$ svn info wikiautocomplete/htdocs/js/wikiautocomplete.js Chemin : wikiautocomplete/htdocs/js/wikiautocomplete.js Nom : wikiautocomplete.js Chemin racine de la copie de travail : *****************************************/wikiautocompleteplugin URL : https://trac-hacks.org/svn/wikiautocompleteplugin/trunk/wikiautocomplete/htdocs/js/wikiautocomplete.js Relative URL: ^/wikiautocompleteplugin/trunk/wikiautocomplete/htdocs/js/wikiautocomplete.js Racine du dépôt : https://trac-hacks.org/svn UUID du dépôt : 7322e99d-02ea-0310-aa39-e9a107903beb Révision : 16611 Type de nœud : fichier Tâche programmée : normale Auteur de la dernière modification : rjollos Révision de la dernière modification : 16602 Date de la dernière modification: 2017-05-20 09:11:25 +0200 (sam. 20 mai 2017) Texte mis à jour: 2017-05-24 15:05:03 +0200 (mer. 24 mai 2017) Somme de contrôle : 586c1f1d6c2ca745f1643cdfaa94784a73aba061
comment:11 Changed 8 years ago by
Please check if the script served by your webserver matches the one in the repository. Navigate to /chrome/wikiautocomplete/js/wikiautocomplete.js
relative to your project base URL.
comment:12 Changed 8 years ago by
Thanks for the relative path to js script. I guess you can check it directly online at the following URL: http://forge.ipsl.jussieu.fr/nemo/chrome/wikiautocomplete/js/wikiautocomplete.js
comment:13 follow-up: 16 Changed 8 years ago by
A repeated warning present in the log but I'm not sure if it is related
2017-05-24 16:28:42,318 Trac[chrome] WARNING: File js/dist/jquery.textcomplete.min.map not found in any of ['/var/www/.python-eggs/WikiAutoComplete-1.3-py2.7.egg-tmp/wikiautocomplete/htdocs']
comment:14 Changed 8 years ago by
NeighborPagePlugin's macros are available only in wiki page. Then, we should check whether formatter.resource.realm
is 'wiki'
.
-
neighborpageplugin/1.0/neighborpage/nav.py
diff --git a/neighborpageplugin/1.0/neighborpage/nav.py b/neighborpageplugin/1.0/neighborpage/nav.py index 4373ac9a7..5a0ba322d 100644
a b from trac.util.translation import _ 14 14 from trac.web.api import IRequestFilter 15 15 from trac.web.chrome import prevnext_nav, add_link 16 16 from trac.wiki.api import WikiSystem, parse_args 17 from trac.wiki.formatter import system_message 17 18 from trac.wiki.macros import WikiMacroBase 18 19 19 20 … … class Macro(WikiMacroBase): 72 73 73 74 content = [len(content) == 0 and _('Previous Page') or content[0], 74 75 len(content) == 0 and _('Next Page') or len(content) == 1 and content[0] or content[1]] 76 if formatter.resource.realm != 'wiki': 77 return system_message("Macro %s is available in wiki page" % name) 75 78 page = formatter.resource.id 76 79 prefix = '/' in page and page[:page.rindex('/') + 1] or '' 77 80 tier = prefix.count('/')
Changed 8 years ago by
Attachment: | Screen Shot 2017-05-24 at 10.23.15.png added |
---|
comment:16 follow-up: 18 Changed 8 years ago by
Replying to ntmlod:
A repeated warning present in the log but I'm not sure if it is related
2017-05-24 16:28:42,318 Trac[chrome] WARNING: File js/dist/jquery.textcomplete.min.map not found in any of ['/var/www/.python-eggs/WikiAutoComplete-1.3-py2.7.egg-tmp/wikiautocomplete/htdocs']
Not sure why that warning would be occurring. The only reference to the source map is commented out.
comment:17 Changed 8 years ago by
comment:18 Changed 8 years ago by
Replying to Ryan J Ollos:
Not sure why that warning would be occurring. The only reference to the source map is commented out.
The // sourceMappingURL=...
line is used by javascript debugger to retrieve the original source for minified javascript source.
Changed 8 years ago by
Attachment: | Capture.png added |
---|
Issue with NeighborPage macros in WikiautoCompletePlugin popup
comment:19 follow-up: 20 Changed 8 years ago by
comment:20 Changed 8 years ago by
Replying to ntmlod:
Well something is going wrong here because I got exactly the error message
What is the path for the page where you see the error?
comment:21 follow-up: 23 Changed 8 years ago by
Nothing particular i.e. ${base_url}/wiki/user/nemo
, my try was for a non-existing wiki page but same result from WikiStart page
comment:22 Changed 8 years ago by
Replying to ntmlod:
Thanks for the patch, I have updated both WikiAutoCompletePlugin and NeighborPagePlugin
There is improvement as WikiMacros local page doesn't show anymore the errors but I still get the same issues in the popup.
Unrelated, created trac:#12820 to improve logging.
p.s. just noticed use of logtalk
WikiProcessor. That one is new to me.
comment:23 Changed 8 years ago by
Replying to ntmlod:
Nothing particular i.e.
${base_url}/wiki/user/nemo
, my try was for a non-existing wiki page but same result from WikiStart page
I can reproduce with Trac 1.0.1. Investigating...
Changed 8 years ago by
Attachment: | t13179.2.diff added |
---|
comment:24 follow-up: 26 Changed 8 years ago by
context
isn't available in the data
dictionary prior to Trac 1.0.2 (trac:r12157).
Proposed fix: t13179.2.diff
Please consider upgrading to Trac 1.0.13. It's tedious to debug and test older versions of Trac.
comment:25 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Thanks a lot rjollos, you finally overcome this ;-)
I should think about giving you the contact details of our forge webmaster to support my own lobbying on the upgrade of our global installation.
comment:26 Changed 8 years ago by
Replying to Ryan J Ollos:
Proposed fix: t13179.2.diff
@psuter Are you okay with this change, or would you prefer to only support Trac >= 1.0.2?
Confirmed.
We can fix this by populating the
Resource
in theRenderingContext
: t13179.diff.