After reading through the documentation I am still at a loss. I have created a node type called feed as node. I also have a content type called feed to create a feed. After creating a feed and having node type as feed items in the dropdown for the node type I want created, it only creates a story node and not my custom content type node.
Any insight is appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | feedapi_refresh_on_create_fix.patch | 3.19 KB | aron novak |
| #7 | feedapi_refresh_on_create_fix_short_version.patch | 969 bytes | aron novak |
Comments
Comment #1
alex_b commentedKeep in mind that changes to the content type are not propagated to existing feed nodes. Only newly created feed nodes are effected.
Comment #2
aglobalwander_ commentedThe steps I have taken:
1. Fresh install. Created a content type called feed as node.
2. Enabled Feed API, FeedAPI Node, and Simple Pie Parser.
3. Created a Feed. Selected the Node type of feed items: Feed as Node.
When the actual nodes are created they are story type and not "Feed as Node" type. Hope this clarifies what I am asking. Newly created feed nodes should be the feed as node type and they aren't.....
Any ideas?
Comment #3
aglobalwander_ commentedNot sure why but I am now getting the action I hoped for. I created a content type called Incoming. Created the feed. The first time the feed is created they are turned into story type although it is set for incoming. Then, I delete the feed items, refresh, and it changes them to incoming type. It works, not sure why it doesn't do it right away though.
Comment #4
alex_b commented#2: thanks for clarification, this sounds like a critical bug to me. I'll bump this issue to critical to make sure we address this for the 1.7 release. Can't take a look at it right now though. Any further insights/fixes are very welcome. I suppose something is wrong when feedapi_node retrieves the node type from $settings when creating feed items from feeds. Do you happen to have 'refresh on creation' on?
Comment #5
aglobalwander_ commentedAfter another complete refresh install, only activing modules related to feed api, I can now create feeds of newly created content types. Not sure why it is working, but is working now. Thanks for your advice.
Comment #6
gomez_in_the_south commentedI was experiencing the same problem when I recently set the option to 'refresh feeds on creation'. The first feed items would choose a different node type to that specified in the feed.
I also found these old threads with the same problem, although they were solved previously:
http://drupal.org/node/236863
http://drupal.org/node/207773
http://drupal.org/node/231472
Unfortunately I didn't get as much time to look at the problem as I would've liked, but maybe what I've found can help others.
Around line 805 in feedapi/feedapi.module, the settings are being passed to the refresh function as follows:
These settings are populated correctly. However in the _feedapi_invoke_refresh function, the settings are retrieved again from the database.
This is returning empty settings for the newly created feed. I didn't have a chance to investigate why this is but I would guess it has something to do with the feed being newly created.
What I did to solve this problem was to tell it instead to use the settings that have been stored in the node previously. So I changed the line (around line 1108)
This caused the items to use the right settings and create the feed items as the correctly specified content type. I'll have to do more testing to see if there are any negative effects from this (with the above code, I'm assuming that the $node object will always already have the settings assigned which very well may not be the case).
Comment #7
aron novakI could reproduce the problem.
Here are two patches to fix the issue. (the style is different, only ONE patch should be applied finally)
Comment #8
gomez_in_the_south commentedI'll test both patches (separately) in the next few days and report my findings. Thanks again.
Comment #9
alex_b commented#7: Could you explain what's the difference between the approaches, and what are the pro and cons for each?
Comment #10
aron novakOf course. In the longer version, the invoke_refresh... does not try to fetch the settings if it's already in the $feed object. But who cares? get_settings() serves it from a static variable.
I vote for the short version.
Comment #11
alex_b commentedShort version it is, then.
Comment #12
alex_b commented#8, Gomez_in_the_South : could you test the patches already? If not: focus on the short patch. I'd like to see whether this is addressing the issues you've reported.
Thank you.
Comment #13
gomez_in_the_south commentedI reverted to the previous version that was causing the problem I described in #6. However creating new feeds worked as it should. i.e I was unable to re-create the problem. I double checked the code as well as cleared the cache so I'm not sure why it is now working. I'm not aware of any other settings that I've changed since, but the site is under active development so it is a possibility.
Anyway, I applied the shorter patch and tested both the creation of new feeds and refreshing of existing feeds and they work as they should. I'm not sure of the reasons for the inconsistency, but I'm pretty confident that the patch is necessary.
Let me know if I can help further.
Comment #14
alex_b commented#13: Thanks for checking so quickly, this really helps.
Yes, the patch is absolutely necessary (pretty obvious bug). I wanted to make sure that it addresses the issue you've reported. I think this is RTBC now (short version).
Comment #15
aron novakThe short version is in.