CCK NodeReference issue when using a view to populate the drop down.
Here's a paste of the issue i filed a while back at http://drupal.org/node/692126
---
Given:
node-type = newsletter-article
which has a nodereferencefield = View used to select the nodes: AND viewname is "newsletter_ref_select"
the view filters to type = newsletter
the view has two fields [title] [field_oub_date]
when view is in DEFAULT the preview works fine
the nodereference setting has a dropdown-list selected to "newsletter_ref_select"
BUT
when I go to node/add/newsletter_article the drop down for "newsletter" shows the proper # of entries BUT they have no visible text. Oddly enough, the value="###" is correctly populate with each Node-ID of the correct results from the view.
It's only the text that is missing. RECALL: the text should be the same as is displayed on the default-preview of the view.
HERE IS THE CRAZY PART!
IF I clear the cache WHILE I'm looking at the node/add form. THEN the page refreshed with the visible text values in the drop down!
BUT IF I refresh the page [f5] then the text disappears with the page load [again the NID values are kept, but title+pub_date is gone]
If I clear cache on any other page then navigate to that node/add form, there is NO text.
I must clear cache FROM the node/add/newsletter_article page in order to get the text visible and not just the value entries.
I have done this on 2 physically different [and rather unique] servers. I have disabled the views override functions in my template.php
Is this a bug or an ID10T err?
- DV

Collin Waid
It sounds like something is
It sounds like something is wrong with the View you are using for the referencenode field. Could you export the view you are using for that and attach it as txt document?
---
Regards,
Collin Waid
Acquia Client Advisory Team
I certainly hope that it's a
I certainly hope that it's a views config issue. I used to think that myself, except that while the view has never changed, it will sometimes work or not work depending on cache being cleared, the presence of other node-ref fields on the edit form, and other bizarre circumstances seemingly unassociated with the situation.
views.txt attached.
Thnx Collin!
Collin Waid
Hm. This is certainly odd. I
Hm. This is certainly odd.
I don't see anything in inherently wrong with the view.
Try this though to ensure it is not the view:
Create a new view. Make it very simple, just create a Page View listing one node type with one field. Create a 2nd node reference field in the same content type and see if it works. If not, make a new content type and try it in that one. Let me know if there is the same problem there.
Also, do you have any caching enabled on your site? Have you tried disabling it and than seeing if the problem still exists?
---
Collin Waid
Acquia Client Advisory Team
I created a new view to show
I created a new view to show only the title of node/33
I created a new content type with a node ref to show that view [only the default is option not the displays]
i turned off all compression and caching.
I cleared cache.
Fail. :-(
Collin Waid
Looks like you aren't the
Looks like you aren't the only one with this problem.
See: http://drupal.org/node/614292
Perhaps you can find a solution/fix in there. Though the issue is still open/active.
---
Hope that helps,
Collin Waid
Acquia Client Advisory Team
Post new comment