Hello everybody,
I created a nodereference field and now I am trying to display only nodes that were created by the authenticated user. I installed Views and created a view for that. It is working great, from the views perspective. The problem is that Drupal is showing an error message saying "Notice: Undefined index" when I access node/add/[new-cck-node-type]. It points to the line 720 in nodereference.module; that is within theme_nodereference_item_advanced().
I've changed my php.ini to:
error_reporting = "E_ALL ^ E_NOTICE"
And they are gone now, but I think this is not only a matter of the level of PHP error reporting.. there is something weird happening. I'm saying that because the select for the nodereference field is showing something like:
9999 - Node title
9991 - Another Node title
9992 - Another Node title again
When the views I created has only Node: Title on the Fields settings.
Why is CCK showing nids as well? Is there any way to clean this?
What about all those PHP error messages?
Thank you,
Andre
Comment | File | Size | Author |
---|---|---|---|
#7 | cck-nodereference-quotes.patch | 617 bytes | Moonshine |
Comments
Comment #1
yched CreditAttribution: yched commentedYes, the 'advanced mode / Views-defined referenceable nodes' is currently broken. This part of the code was adapted from CCK D5 to match the new Views 2 API some time ago, and Views has been moving since then.
I'm currently refactoring this area to rely on Views 2 notions of 'display plugin'. Stay tuned.
Comment #2
yched CreditAttribution: yched commentedSide note : meanwhile, and with the PHP warnings and display issues you mentioned, node submission still works and the nodereference field saves correctly.
Comment #3
KarenS CreditAttribution: KarenS commentedIt's broken again? I've fixed it several times :-( It's pretty hard to keep up with Views sometimes, not that it hasn't been more than worth the trouble :-)
Comment #4
avorio CreditAttribution: avorio commentedThank you very much, Yves. I'm sure this integration could look amazing.
Let me know once you're ready and count on me for testing.
[]s
Comment #5
yched CreditAttribution: yched commented@avorio : I'm afraid you won't see much difference from the outside :-)
Comment #6
yched CreditAttribution: yched commentedFixed. Still a few todos, but the thing works.
This uses dedicated views display and style plugins to have the view return a PHP array of results. Parts of this could be rolled into a later patch for Views, since this can be a common use. For now it lives in nodereference.module (which has its own specific needs anyway).
User-facing results of this patch are that admins have a few more possibilities to tweak the content of their select widgets or autocomplete results using Views 2 display options goodies.
Comment #7
Moonshine CreditAttribution: Moonshine commentedYched,
Thanks for this great addition ! I've been doing quite a bit with it. I did run into one situation that shows up when doing Select lists from views with output that has single quotes in them. (they appear as ' ) I believe this is because check_plain() actually encodes them specifically:
So attached is a patch that adds them in for decoding...
Comment #8
Moonshine CreditAttribution: Moonshine commentedHave update the fix above and re-posted the patch to a new issue. Moving this back to fixed.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.