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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Aron Novak’s picture

Status: Active » Closed (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.

sockah’s picture

Thanks Aron, I will look into that solution.

benkewell’s picture

Version: 6.x-1.8 » 6.x-1.x-dev
Component: Code feedapi (core module) » Code feedapi_inherit
Status: Closed (duplicate) » Needs review
FileSize
902 bytes

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.

Aron Novak’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
1.2 KB

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 :) )

Aron Novak’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you!

Status: Fixed » Closed (fixed)

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