#10877 closed defect (fixed)
Invalid JSON breaks custom query builder
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | high | Milestone: | 0.12.5 |
Component: | query system | Version: | 0.12dev |
Severity: | major | Keywords: | javascript to_js_string |
Cc: | Branch: | ||
Release Notes: |
Fix a mistake resulting in invalid JSON data generated on the server with Python 2.4 or 2.5. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
I just upgraded from 0.11.6 to 0.12.4 (and now 0.12.5dev-r11368) and am now getting a javascript syntax error on the custom query page. The offending javascript is the following:
var modes={"id":[{"name":"is","value":},{"name":"is not","value":"!"}],"select":[{"name":"is","value":},{"name":"is not","value":"!"}],"text":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"},{"name":"begins with","value":"^"},{"name":"ends with","value":"$"},{"name":"is","value":},{"name":"is not","value":"!"}],"textarea":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"}]};
To be sure, I check the generated JSON on the Demo site running Trac 0.12.5dev-r11311. Sure enough, that JSON is valid:
var modes={"id":[{"name":"is","value":""},{"name":"is not","value":"!"}],"select":[{"name":"is","value":""},{"name":"is not","value":"!"}],"text":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"},{"name":"begins with","value":"^"},{"name":"ends with","value":"$"},{"name":"is","value":""},{"name":"is not","value":"!"}],"textarea":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"}]};
I wonder if this bug is related to the version of python (2.4.3) I am running, and is similar in scope to #10771.
-
json.txt
2.6 2.4 1 var modes={"id":[{"name":"is","value": ""},{"name":"is not","value":"!"}],"select":[{"name":"is","value":""},{"name":"is not","value":"!"}],"text":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"},{"name":"begins with","value":"^"},{"name":"ends with","value":"$"},{"name":"is","value":""},{"name":"is not","value":"!"}],"textarea":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"}]};1 var modes={"id":[{"name":"is","value":},{"name":"is not","value":"!"}],"select":[{"name":"is","value":},{"name":"is not","value":"!"}],"text":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"},{"name":"begins with","value":"^"},{"name":"ends with","value":"$"},{"name":"is","value":},{"name":"is not","value":"!"}],"textarea":[{"name":"contains","value":"~"},{"name":"doesn't contain","value":"!~"}]};
Attachments (0)
Change History (6)
comment:1 by , 12 years ago
Description: | modified (diff) |
---|---|
Keywords: | javascript to_js_string added |
Owner: | set to |
Severity: | normal → major |
comment:3 by , 12 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Applied in r11382.
follow-up: 5 comment:4 by , 12 years ago
Oooh. Sorry, I'm so stupid…. Thanks the reporter and Christian!!
comment:5 by , 12 years ago
Replying to jomae:
Oooh. Sorry, I'm so stupid…. Thanks the reporter and Christian!!
Well, I get most of the blame, given all the iterations I triggered… and my final review saying "perfect" ;-)
comment:6 by , 12 years ago
I opened #10982 because this also needs to be done for 1.1, 1.0.x, and 1.1.x.
Damn, you're right, we've made a blunder here.
trac/util/text.py
'trac/util/tests/text.py