Not sure if this is a CCK or Views bug, but CCK fields no longer appear in an RSS feed. All I see is titles. I can add the fields with Contemplate though.

CommentFileSizeAuthor
#6 cck_rss.patch3.33 KBgordon
#4 cck_rss.patch3.79 KBgordon

Comments

moshe weitzman’s picture

Status: Active » Closed (duplicate)

i believe that happenned with http://drupal.org/node/107128 ... anyway, this is a dupe of http://drupal.org/node/89523. lets discuss there

leoklein’s picture

Status: Closed (duplicate) » Active

Moshe, are you sure this is a dupe of http://drupal.org/node/89523?

The problem here is that none of the CCK fields are showing up in the RSS Feed.

I noticed the problem when I wanted to created a Feed with Title and an Image Field.

aaron’s picture

Version: 5.x-1.3 » 5.x-1.6-1
Component: Views Integration » content.module
Category: bug » feature

I think this is still an issue? http://drupal.org/node/89523 is a duplicate of itself, though, and there's no other issue I can find for it. Although maybe at this point it's now a feature request rather than a bug, considering comments in http://drupal.org/node/107128

gordon’s picture

Assigned: Unassigned » gordon
Status: Active » Needs review
StatusFileSize
new3.79 KB

I have done a little work on this and I think I have it working.

yched’s picture

Sidenotes :
- You left your db credentials in the patch (no secret passord disclosed :-) )
- The feature should already be in HEAD (CCK D6), D6 makes this easier on us - although I have to say I don't think I actually tested the thing :-)

About the patch itself :
- the $body =& ... part doesn't seem that nice - can't we render the content first and then append it to either $node->body or $node->teaser ?
- actually, I'm not sure I get the need for the 'rss item' op : the fields get rendered by the 'view' op anyway, right ? So isn't the customizable 'rss' context enough for what we're after ?

I know I spent a little time on the question of rss items back when we worked on http://drupal.org/node/107128, but that's about a year ago, and this has dimmed a bit in my head :-) Could you provide a short explanation on what the patch is doing and why it's needed ?

gordon’s picture

StatusFileSize
new3.33 KB

I have cleaned up the patch and removed the changes to the settings.php file.

1. Basically I have added a new context called RSS which allows you to set up which fields are going to be viewed on the the RSS feed.
2. I then added the 'rss item' to the nodeapi so that it will re-render the cck fields to only display the fields required and add this to the body or teaser. Also added call to fieldgroup_nodeapi() to update the groups.
3. Made the content_view() based more on context instead of working like the hold hook_view(). This is no longer used since cck is purely done via nodeapi now.
4. Add rss context to fieldgroup_nodeapi().

There is some problems with how the labels are rendered in the rss feed since there is no css to display them as required. So inline doesn't really work.

yched’s picture

1 and 3 I get.
2 and 4 I don't - I'd expect 1 and 3 to be enough. What happens if you don't add the 'rss item' op ?

(OK, I guess running the patch in a debugger would make that clear to me, but since you did the job of actually writing it, you probably have the answer already ?)

gordon’s picture

The main reason that you need the 'rss item' is because :-

1. node_feed() doesn't call drupal_render(), and CCK adds all the display to $node->content and thus is does get rendered into $node->teaser/$node->body
2. Since context has been added and rss being a context you need to reprocess the fields, and you just can remove the hidden ones since it may be rendered different to that of body/teaser. This is the same reason for fieldgroup_nodeapi()

gordon’s picture

Also it is a pity that node_feed() doesn't pass a flag that says it is going to be added to a feed, then you could remove most of the rss item op, so you are only rendering the fields once.

yched’s picture

- 'rss item' op : OK, got it, thx for the explanation :-) With that in mind I'll try to give a closer review asap.
- 'it is a pity that node_feed() doesn't pass a flag (...)' : yeah, that's precisely what we managed to get in D6 : http://drupal.org/node/152493 :-)

fuzzy_texan’s picture

Subscribing

yeeloon’s picture

would there be a patch or an updated release for CCK 5x ?

reynolds23’s picture

I implemented this patch, and it did pull in the fields that were previously being ignored, but it was pulling in all the other information twice. In my case I was trying to display the Location field for events, but I had to revert back to the original files because when I implemented this patch it pulled in entries that looks like this...

Start: Apr 17 2008 - 9:30am
End: Apr 17 2008 - 11:30am
Timezone: Etc/GMT-5
Participants will create a resume using Winway Resume and a formatted template. (Bring a 31/2 floppy disk or USB Drive and information to be included in your resume)
Start: Apr 17 2008 - 9:30am
End: Apr 17 2008 - 11:30am
Timezone: Etc/GMT-5
Participants will create a resume using Winway Resume and a formatted template. (Bring a 31/2 floppy disk or USB Drive and information to be included in your resume)
Location:
Main Library

reynolds23’s picture

I figured out how to implement this patch, but I have information repeating. Does someone know which lines I need to alter or delete to keep information from repeating? Here's the RSS feed I'm working with. Info is only repeated in RSS feeds... http://www.cpl.org/?q=events/computer

Bèr Kessels’s picture

Applied and tested on a 5.x version with seven feeds, eight complex content types and tens of thousands of posts and users.

The patch does not break any existing settings, teaser lists, views and/or full node views.

It adds the content to the RSS items as expected.

Small downside, is that the already existing mis-design of the content-display shows up more obvious here. That mis-design is that the "labels" can only be configured 'for all contexts'. Say I want to show a lable in the fullnode, but not in teaser, the current interface does not allow this.
With this patch, as mentioned this problem becomes worse: we add a big load of *unstyled* (and therefore very ugly and confusing) HTML to the rss item.
But since that problem is certainly not introduced with this patch it should not hold this patch from going in. It is just something people should be aware off when rolling out.

This is only one test. enought to change status to tested and reviewed?

Bèr

Kuldip Gohil’s picture

i am in for getting new updates...

joncup’s picture

Status: Needs review » Needs work

Ok, just tested the patch. Appears fine at first glance, but with closer inspection, each field set to display is lumped together in one description tag, and all the special chars get badly mangled. Looks alright in the browser, but doesnt agregate well. Would like to see fields in thier own tags, and the char mangling is a problem too. Also, seems output doesn't respect the "Above or Inline" setting for labels.

yched’s picture

Version: 5.x-1.6-1 » 6.x-2.x-dev

Sorry for letting this fall out of our radar.
Still an issue in CCK 6, let's get it fixed here first. We need to look re-familiarize with gordon's patch in #6.
Although, as I pointed in #310846: no CCK Fields in RSS (before realizing it was a dupe of this one) :

"
This is because what we do in nodeapi('view') is add a render structure to $node->content - which, AFAIK, is what nodeapi('view') implementations are supposed to do (http://api.drupal.org/api/function/hook_nodeapi/6).

However, unlike node_view(), node_feed() completely neglects $node->content and only considers what's in $node->[body|teaser], thus dropping all nodeapi additions (not only CCK fields). I'd be tempted to say it's a core bug, but I might very well be overlooking something.

Besides, it looks like this part of node.module's node_feed() is odd :

// Allow modules to change $node->teaser before viewing.
node_invoke_nodeapi($item, 'view', $teaser, FALSE);

Since D5, changing $node->teaser is not what hook_nodeapi('view') is supposed to do...
"
My 1st impression is that node_feed didn't get properly updated from 4.7...

@joncup : "each field set to display is lumped together in one description tag (...) Would like to see fields in thier own tags"
That's the intention here - having cck fields a separate xml tags in the item is a different feature - you might want to check #316107: CCK Fields as elements in Views with XML Data Document (Views2 / D6)

Anonymous’s picture

I'm running around in circles trying to understand a problem I'm having with CCK fields never appearing in RSS feeds whether through views or Drupal's core feed features.

Does the RSS display setting for CCK fields have absolutely no effect right now because of the inconsistency yched explains in #18 above? (node_view uses the content property of the node object, but node_feed uses only the teaser or body.)

I'm trying to decide if this is a problem I've created for myself that I need to overcome or if this is a problem that others are having, so I should rely on the workaround of using contemplate until there's a solution to this issue?

heather’s picture

tagging this so i can follow responses to bangpound's question. ~ tnx

heather’s picture

Can anyone summarize the best solution to this problem- to get CCK fields to show in an RSS feed?

I'm making an RSS feed using views, and the custom CCK fields aren't showing up,

can I do this without using Contemplate? or is that the only solution at this stage for a production site?

nsyll’s picture

Title: Fields not appearing in RSS feed » Fields doesn't appear in RSS feed

also cck field doesn't appear in rss feed even you use content template module http://drupal.org/node/340540

Mac Clemmens’s picture

subscribing

cardentey’s picture

subscribing

capellic’s picture

I am trying to do the same thing - add a CCK field (ImageField) to the output of the description element in the RSS feed. But this might be a Views problem?

Views doesn't seem to provide the ability to define fields for display of type "Feed". You get only these options: Full text, Title plus teaser, Title only & Use default RSS settings. I was hoping that the default would pick up the display fields settings from CCK - but no luck there.

I did some digging in the Views issue queue and this looks promising but it's a patch of the DEV version as of January 1, 2009

http://drupal.org/node/353090

Here's another issue in the Views queue dedicated to the problem:

http://drupal.org/node/316107

In any case, there doesn't seem to be a "stable" solution.

interestingaftermath’s picture

subscribing. This is a huge problem.

Fintan Darragh’s picture

Category: feature » bug

I've been encountering this problem with the latest releases of Views and CCK, too.

It doesn't seem to affect standard title/body nodes; only fields from CCK.

alanBrookland’s picture

Subscribing

pedropablo’s picture

Just confirming views dev version solves the problem and is able to use contemplate settings. That's more than enough for me!!

drewish’s picture

i think that using hook_nodeapi is the correct solution for feeds in D6.

yched’s picture

Status: Needs work » Closed (duplicate)
tignux’s picture

The patch in #6 works perfectly in D5.
The only problem I have is with the image size (I use imagecache). The feed display always the full size image.

Thanks gordon

Rameez’s picture

Version: 6.x-2.x-dev » 6.x-2.6
Status: Closed (duplicate) » Needs work

Subscribing

I've been encountering this problem with the latest releases of Views and CCK, too.

joncup’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)