A taxonomy active-select menu has recently stopped working on my site whenever I was logged in as admin. After some confused debugging, I traced this to the following message in the JS Error Console:
Error: missing ) in parenthetical
Source File: htt p://blades.ermarian.net/misc/drupal.js
Line: 131, Column: 197
Source Code:
({ "field-category-children": { "options": { "0": { "value": "---" }, "3": { "value": "G", "selected": true }, "5": { "value": "PG" }, "4": { "value": "R" } }, "multiple": "" } }<div class="dev-query">Executed <em>17</em> queries in <em>82.4
It's fairly obvious that the query timer output is breaking the page.
I'm not sure if this module conflict ought to be here or in activeselect - perhaps avoid sending query info if the content type is not set to html? Or perhaps activeselect should exit() after sending to prevent the devel module from displaying stuff.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | activeselect_json_header-212465-2.patch | 712 bytes | cburschka |
Comments
Comment #1
moshe weitzman commentedactiveselect needs to send set a header for text/javascript along with the json. see druapl_set_header()
Comment #2
cburschkaAh, k. Didn't see that activeselect never actually set its content header. I'm patching forthwith.
Note that the actual error in this case does not strictly speaking lie with activeselect, but with content_taxonomy_activeselect, which provides hierarchical taxonomy selection and has its own JSON page callback.
However, as activeselect provides a central "no cache" header function that all these page callbacks are supposed to use, it shouldn't hurt to send a text/javascript header by default. As header() replaces previous headers by default, there is no danger of trying to send duplicate content types either.
Addendum: Please note that the other header() calls should strictly speaking be drupal_set_header() calls. That is a matter for another issue, however.
Comment #3
hazaThis version of Active Select is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.