#11378 closed defect (fixed)
Missing dynfields.js
Reported by: | Owned by: | Rob Guttman | |
---|---|---|---|
Priority: | normal | Component: | DynamicFieldsPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
I get the following complaint in my Trac 1.0.1 log:
2013-11-01 10:48:08,291 Trac[chrome] WARNING: File dynfields.js not found in any of ['/usr/lib/python2.7/site-packages/TracDynamicFields-2.2.0dev-py2.7.egg/dynfields/htdocs'] 2013-11-01 10:48:08,320 Trac[main] WARNING: [10.209.160.46] HTTPNotFound: 404 Not Found (File dynfields.js not found)
Should this file exist? I do not see it in the .zip file I downloaded from TracHacks. If it should not exist, how can I disable the warning? It happens a lot.
Attachments (0)
Change History (12)
comment:1 Changed 11 years ago by
comment:2 follow-up: 3 Changed 11 years ago by
I installed the 0.11 branch. I will wait for any updates.
Nonetheless, as a learning experience, the 0.12 code is:
def post_process_request(self, req, template, data, content_type): if ((req.path_info.startswith('/ticket') or req.path_info.startswith('/newticket')) and \ req.perm.has_permission('TICKET_MODIFY') \ ) or ( \ req.path_info.startswith('/query') and \ req.perm.has_permission('REPORT_VIEW')): add_script(req, 'dynfields/dynfields.js') add_script(req, 'dynfields/layout.js') add_script(req, 'dynfields/rules.js') return template, data, content_type
In the directory tree, dynfields.html is in a directory called templates. Would you suggest I change 'dynfields/dynfields.js' to 'dynfields/templates/dynfields.html'? I will use 0.11. I am just curious.
comment:3 Changed 11 years ago by
Replying to roger@…:
In the directory tree, dynfields.html is in a directory called templates. Would you suggest I change 'dynfields/dynfields.js' to 'dynfields/templates/dynfields.html'? I will use 0.11. I am just curious.
It should work to change dynfields/dynfields.js
-> dynfields/dynfields.html
. The path is "chrome-relative" path, which is different from the relative path of the file in the package.
I'll plan to fix this in the 0.12
branch before closing this ticket.
comment:4 Changed 11 years ago by
I think we could simply fix it.... The issue has been introduced in [9690#file2].
-
dynfields/web_ui.py
44 44 ) or ( \ 45 45 req.path_info.startswith('/query') and \ 46 46 req.perm.has_permission('REPORT_VIEW')): 47 add_script(req, 'dynfields/dynfields.js') 47 # don't remove leading '/' character 48 add_script(req, '/dynfields/dynfields.js') 48 49 add_script(req, 'dynfields/layout.js') 49 50 add_script(req, 'dynfields/rules.js') 50 51 return template, data, content_type
comment:5 follow-up: 6 Changed 11 years ago by
Oh, right, it is not a chrome-relative path, as we also saw with #7617.
Shouldn't the 0.11 branch also be adding /dynfields/dynfields.js
rather than /dynfields/dynfields.html
?: dynamicfieldsplugin/0.11/dynfields/web_ui.py@11518:40#L28
comment:6 Changed 11 years ago by
Shouldn't the 0.11 branch also be adding
/dynfields/dynfields.js
rather than/dynfields/dynfields.html
?: dynamicfieldsplugin/0.11/dynfields/web_ui.py@11518:40#L28
Looks good to me. However, 0.11 branch currently works well even if the suffix is .html
cause the suffix isn't checked, dynamicfieldsplugin/0.11/dynfields/web_ui.py@11518:47-52#L42.
comment:7 Changed 11 years ago by
Okay, cool. I think it should be okay if you go ahead and push the change. Thanks!
comment:8 follow-up: 10 Changed 11 years ago by
In the .zip file I just downloaded, there is no file called dynfields.js:
unzip -l dynamicfieldsplugin-13437.zip| grep js 6132 2012-04-30 02:11 dynamicfieldsplugin/0.11/dynfields/htdocs/layout.js 11558 2012-05-15 13:10 dynamicfieldsplugin/0.11/dynfields/htdocs/rules.js 5333 2010-12-16 00:47 dynamicfieldsplugin/0.12/dynfields/htdocs/layout.js 5077 2010-12-16 00:50 dynamicfieldsplugin/0.12/dynfields/htdocs/rules.js
I guess that will be added as well as the changed reference.
comment:10 Changed 11 years ago by
Replying to roger@…:
In the .zip file I just downloaded, there is no file called dynfields.js:
That is how it should be since it is a virtual script. The JavaScript code is contained in templates/dynfields.html
. Have no worries, it should work correctly even on the 0.12 branch following the change that Jun just pushed.
comment:11 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
You must be running the 0.12 version, which is not recommended according to the project wiki page. In the 0.12 version, the dynfields script is still implemented as a virtual script, dynamicfieldsplugin/0.12/dynfields/templates/dynfields.html@8694, and it looks like the issue you mention is an error in the code.
You should probably reinstall from the 0.11 branch, but if you decide to stick with the 0.12 version, change
dynfields.js
->dynfields.html
at dynamicfieldsplugin/0.12/dynfields/web_ui.py@9690:47#L40.