Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On Views 6.x-3.0-alpha3 each time I add an argument then this error displayed:
"warning: Invalid argument supplied for foreach() in /home/mysite/public_html/includes/form.inc on line 1211."
- Views can Preview data correctly but CCK nodereference (using Views+arguments) only display 1 row (don't know if this issue related to Views or CCK, but CCK shows no error when create nodereference views, so I posted here)
NB:
I'm using:
- Drupal 6.19, PHP 5.2.14
- jQuery Update 6.x-2.0-alpha1
- Content Construction Kit (CCK) 6.x-3.x-dev (2010-Aug-26)
- jQuery UI 6.x-1.3
Any idea where this error come from?
Comment | File | Size | Author |
---|---|---|---|
#6 | views_export_generic_select_list.txt | 4.2 KB | drupalnesia |
#6 | inventory_product_cck_views_error.jpg | 21.34 KB | drupalnesia |
#6 | cck_inventory_product.txt | 8.62 KB | drupalnesia |
#6 | cck_master_unit.txt | 1.22 KB | drupalnesia |
views_invalid_argument_1211.jpg | 27.92 KB | drupalnesia |
Comments
Comment #1
dawehnerDid you tryed the dev version already? It's fixed there already.
Comment #2
drupalnesia CreditAttribution: drupalnesia commentedUsing Views 6.x-3.x-dev (2010-Aug-18): Error fixed.
But ... CCK node reference using Views+arguments still shows 1 row data only.
Does this error related to CCK nodereference instead Views?
Comment #3
dawehnerhttp://drupal.org/node/571990
I just thought you have one issue per issue, but i was wrong, sorry.
What do you expect it should do? Read the link above to report a bug. People shouldn't guess everything.
Comment #4
drupalnesia CreditAttribution: drupalnesia commentedThe CCK nodereference using Views+argument should display all values.
I create 2 content-type: Inventory Product List (invprd) and Unit Measurement (masunt). And a View with argument = node type.
The Product contains a Product-Unit field, with this settings:
- field type: nodereference
- views name: generic_select_list
- arguments: masunt
So, the CCK nodereference should show all value related to the arguments that passing to Views. But CCK noderefence only show 1 value.
Comment #5
dawehnerPlease read the link and paste a) a export and b) the generated sql.
As the document said the issue could be set to won't fix
Comment #6
drupalnesia CreditAttribution: drupalnesia commentedHere is the SQL generated by Views when I enter argument = "masunt":
----------------------------------
SELECT node.title AS node_title,
node_revisions.teaser AS node_revisions_teaser,
node_revisions.format AS node_revisions_format
FROM node node
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
WHERE (node.status <> 0) AND (node.type = 'masunt')
ORDER BY node_title ASC
Comment #7
dawehnerThanks!
What really confused me here is that you have a node: type argument
Comment #8
drupalnesia CreditAttribution: drupalnesia commentedYes, because we must enter the arguments value in the Live Preview, otherwise the output will be:
- Query = No query was run
This is related to Views-arguments settings:
- Action to take if argument is not present: Hide view / Page not found (404)
Comment #9
drupalnesia CreditAttribution: drupalnesia commentedUPDATE:
--------
I switch back to Views 6.x-2.11 and now CCK (6.x-3.x-dev 2010-Aug-26) nodereference using Views with Arguments works fine!
Comment #10
dawehnerEven needs work means that there is a patch
Comment #11
dagmarThe title for this issue is wrong. Please change it.
Comment #12
drupalnesia CreditAttribution: drupalnesia commentedComment #13
liquidcms CreditAttribution: liquidcms commentedjust subscribing and reporting my versions which also show this not working. I have Views 6.x-2.11 and CCK 6.x-2.8 (latest release of both).
Will try upgrading to cck 3.x
Comment #14
liquidcms CreditAttribution: liquidcms commentedupgraded to 6.x-3.x-dev (2010-Aug-25) and still does not return more than 1 row from the View.
this isn't a consistent issue though since i have other noderef fields which use different views and they work correctly.. so something specific to this view.
Comment #15
liquidcms CreditAttribution: liquidcms commentedi think my issue is actually this one: #290682: Node reference views relationships should provide the referred node and not the referring one and is with CCK not Views
Comment #16
clashar CreditAttribution: clashar commentedsubscribe
Comment #17
clashar CreditAttribution: clashar commentedsorry, duplicate
Comment #18
entrigan CreditAttribution: entrigan commentedWorkaround: add the nid or uid (for user reference) to the view
Comment #19
Letharion CreditAttribution: Letharion commentedCan this be reproduced with the recently released 3.0-alpha1 of CCK?
Comment #20
esmerel CreditAttribution: esmerel commentedComment #21
vlooivlerke CreditAttribution: vlooivlerke commentedI have the same issue. Adding the nid does not work.
I have the latest views 3 dev
Comment #22
vlooivlerke CreditAttribution: vlooivlerke commentedopening issue again.
To reproduce create a view with user nodes as relationship.
A basic view that will show all user nodes when you view a node of a user. The view work and display multiple nodes, but in the node reference drop down there is only (1) node.
Comment #23
merlinofchaos CreditAttribution: merlinofchaos commentedIf you're using a module that utilizes the node_access table, Drupal's db_rewrite_sql will add DISTINCT to the query which will cause this result. There is nothing Views can do about this distinct, other than to not let Drupal rewrite the query; if using Views 3.x there is an option to disable sql rewrite in the query options. Use that; this means that the query will no longer be subject to node_access rules and content the user does not have access to may appear, but it is the only solution.
Comment #24
vlooivlerke CreditAttribution: vlooivlerke commentedWow thanks for the quick response, but I tried your solution but no success.
Here is my simple view that shows only 1 row in node reference selection. Maybe I am doing something wrong. Is there any other way to get a similar view?
Comment #25
merlinofchaos CreditAttribution: merlinofchaos commentedWhile you have disabled SQL rewriting, you also have enabled the flag to add DISTINCT to the query, which is the problem to begin with. Uncheck that box and it should begin working.
Comment #26
vlooivlerke CreditAttribution: vlooivlerke commentedHi, making
Stills shows only 1 node in node reference.
I am using domain access, can this be the problem?
Comment #27
sirpy CreditAttribution: sirpy commentedi've been able to use node reverse reference module to get the expected result