Feeds Not Showing Properly In Forums

sockah - August 28, 2009 - 14:28
Project:FeedAPI
Version:6.x-1.x-dev
Component:Code feedapi_inherit
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

First off, great module. I searched for my problem but was unable to find any solutions.

I have created a feed that will create nodes as forum topics. In the feed edit screen, I have selected a forum for it to post in.

When cron runs and the feed updates, nodes are created for the new forum topics. They are listed as published.

However, they do not appear in the forum. Only when I click edit on the topic and save (without changing anything) do they appear.

Does anybody have an idea of why this is happening and how to fix it?

Thanks.

#1

Aron Novak - August 28, 2009 - 18:59
Status:active» duplicate

Unfortunately this is an already known issue:
#367111: Wrong use of node_save()
It's pretty hard to fix. Anyway, it's not so hard, but one of the possible solutions has poor performance:
http://drupal.org/node/367111#comment-1720612

So maybe you can patch your copy of feedapi and see it this helps or not. The patch likely won't apply cleanly to the HEAD, fetch the proper revision from the CVS.

#2

sockah - September 11, 2009 - 20:20

Thanks Aron, I will look into that solution.

#3

BenKewell - October 7, 2009 - 12:16
Version:6.x-1.8» 6.x-1.x-dev
Component:Code feedapi (core module)» Code feedapi_inherit
Status:duplicate» needs review

i tried to create forum topics from feed using feed_inherit and ran into this issue.
it is found that the forum topics are created with the correct taxonomy terms,
but not displayed in the forum list.
the forum topic count includes the topics created by feedapi,
but they are just not displayed in the list of topics.

a few checks on the code disclosed that forum_nodeapi and taxonomy_nodeapi are called when new nodes are saved by feedapi
so I believe this is not related to issue #367111: Wrong use of node_save()

it is found that forum_nodeapi checks the taxonomy terms of a node when being called with op 'presave',
determines the term indicating the forum that the node belongs to,
and save it in its own database table {forum}

however, forum_nodeapi sees $node object in the way it is submitted by node edit form, where $node->taxonomy should look like:

Array
(
    [vid] => tid
)

while feedapi_inherit insert taxonomy data into $node->taxonomy to be saved in the way that $node is loaded by node_load, i.e.:

Array
(
    [tid] => stdClass Object // $term object
)

as a result forum_nodeapi failed to save the new node to its own database table,
so the new node is created and counted but not displayed by forum.

the attached patch changes the way $node->taxonomy is saved by _feedapi_inherit_do_inherit(),
so that the taxonomy terms can be recognized by forum and other modules that work in the same way as forum.

it has been tested on my website and is working fine.

AttachmentSize
feedapi_inherit.module.patch 902 bytes

#4

Aron Novak - October 26, 2009 - 21:24
Status:needs review» reviewed & tested by the community

Thank you, the patch seems to be fine!
I just tried it out and the term was inherited.
Do you think the two ways are identical when feedapi does the inheriting?

(FYI: http://drupal.org/node/323 , do not consider this offensive :) )

AttachmentSize
562276_inherit_taxo.patch 1.2 KB

#5

Aron Novak - October 31, 2009 - 16:05
Status:reviewed & tested by the community» fixed

Committed. Thank you!

#6

System Message - November 14, 2009 - 16:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.