Hi,
I think we need to do a strict search in in_array() like below. Otherwise the js loads on all content types.
/**
* Invoke the plugin if we support it for this node type.
*/
function jquery_media_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
if ($op == 'view') {
if (in_array($node->type, variable_get('jquery_media_node_types', array()), TRUE)) {
jquery_media_add();
}
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 509576-2.patch | 543 bytes | roderik |
| #1 | 509576.patch | 543 bytes | roderik |
Comments
Comment #1
roderikTrue. (Independently traced & fixed, then found this bug report.)
variable_get('jquery_media_node_types', array()) is
... and comparing a string value 'non-strict' against an array which contains int(0), seems to always return TRUE, because (int)$node->type is 0 as well => match.
See http://www.php.net/manual/en/function.in-array.php#102681
Comment #2
roderikIt of course helps if I provide, like, a correct patch.
Pesky brackets...
Comment #3
edgarpe commentedPatch #2 works for me too.