when you set view arguments to be passed to the selected view to display the nodes, the arguments are handled incorrectly in code leading to them being lost, patch included below
the view arguments are a comma separated string of arguments, the string is exploded into an array which is then concatenated to a string leading to the string having the value "Array"
as far as ive learned, the view_args should be an array of arguments, i am not sure why passing a string as an array's element [0] doesnt work in my case, if i just pass the string along, it works, but you wont be able to send multiple arguments and this should be FIXED if possible, i dont have time to dig on this right now so i would appreciate any advice
--- ./nodereference_explorer/includes/nodereference_explorer.views.class.inc 2009-09-19 07:37:13.000000000 +0000
+++ ./nodereference_explorer/includes/nodereference_explorer.views.class.inc 2009-09-19 11:12:28.000000000 +0000
@@ -56,7 +56,7 @@ class nodereference_explorer_views {
if (!empty($this->field['advanced_view_args'])) {
if (!empty($this->view_args)) //append to existing arguments
$this->view_args .= ',';
- $this->view_args .= explode(',', $this->field['advanced_view_args']);
+ $this->view_args .= $this->field['advanced_view_args'];
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | nodereference_explorer_582066_2_GN.patch | 1.78 KB | gnindl |
| #3 | nodereference_explorer_582066_cck_field_arguments_20091109.patch | 1.44 KB | gnindl |
Comments
Comment #1
phayes commentedI can confirm that this patch at least makes arguments work for single cases. I banged my head against trying to get it to work with multiple arguments to no avail. I need to learn more about the views API.
Comment #2
abaddon commented"..but you wont be able to send multiple argument..", yea that one is not fixed yet, if no one else steps out to fix it ill give it a shot the next weekend, i need to be sure on how the code interacts inside drupal to be able to do it properly
Comment #3
gnindl commentedMultiple values per argument: Separate values by a "+" or ',' sign, e. g. for "Node:Nid" set views arguments like this "123+456+789" or "123,456,789"(three nids)
Multiple arguments: Separate by a slash "/", e. g. first "Node:Nid" and second "Node:Type" => "123+456/page"
Supporting multiple arguments is tricky because the function views_embed_view() accepts only single arguments, not arrays! Now there is an ugly manual hack supporting 20 multiple arguments which should be sufficient for the most use cases;
Comment #4
abaddon commentedthis should really be marked as needs work, if someone has the time to look over it should be an easy one, im also not sure on the security implications of using uninitialized $arg_ variables for views_embed_view(), combined with register globals might blow
Comment #5
gnindl commentedWith this patch the function views_embed_view() is called by name. Therefore all arguments can be passed as an array which s#hould fix the security issues of #3.
Comment #6
gnindl commentedPatch included in this release candidate.