Closed (fixed)
Project:
Leech
Version:
5.x-1.6
Component:
General
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Feb 2007 at 22:11 UTC
Updated:
24 May 2007 at 14:31 UTC
Jump to comment: Most recent file
Hello,
Just grabbed the new Leech for drupal 5.x and when I update the leech items, it tells me that the group settings of child items were updated but nothing is actually happening. I have the template story and the feed story both set to automatically go into an organic group I have setup, but it leaves the child items with no group association at all.
Any advice?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | leech.txt | 100.39 KB | tonythemediaguy |
Comments
Comment #1
tonythemediaguy commentedJust a test, I installed the new 5.x Aggregator module and set it up with the same feed info as Leech. When it updated it's feed, it did mark the feed's items as belonging to the appropriate groups. I thought the problem might be with OG, but after this I'm confident it's in the way that Leech updates the items with OG info.
Comment #2
tonythemediaguy commentedLeech isn't writing anything to the og_ancestry table, so I added this at line 2603:
It adds them in everytime the cron is run, creating hundreds of duplicates in the og_ancestry table but for now it's solving my small issue.
But along with Leech not using the audience correctly, it's also not sending out the og emails for those who subscribed to the group.
Comment #3
kaerast commentedOK, well the obvious next steps now are to add some conditions to that statement:
a) detect if organic groups is installed
b) do a "SELECT count(*) FROM {og_ancestry} WHERE nid = $n->nid AND group_nid = $gid" in order to avoid duplicates.
Should leeched items really be public though? We're presuming they should be public because they are available elsewhere - but that might not be the case.
I'm assuming there's a better way of doing this, one which will use OG APIs to send out the group email and set group details. I haven't got time to investigate myself though.
Comment #4
tonythemediaguy commentedHere is the code that Leech uses to call up OG:
As far as everything being public, for now that's ok for my purpose, but would ultimately need to choose what is public and what isn't.
Comment #5
tonythemediaguy commentedOK, I got Leech and OG working pretty well for now by adding the DELETE FROM right before it puts the articles into the og_ancestry table. This keeps the duplicate entrys from happening. Works great.
But it doesn't send out the emails to those who have subscribed to the group. How can I call up the function in organic groups from leech that sends out the emails? In the og_module the function is called og_mail but I don't know enough about php to tell this function to run everytime Leech updates these groups.
Any help is appreciated.
Comment #6
aron novakThanks for your efforts trying to make leech work with og! Can you send me a patch: 1.6 vs. current state of your code?
As I understood you almost reached that leech + og works smoothly, only the email sending don't work, right?
When I receive your patch I'll find a solution to fix this remaining issue.
Comment #7
tonythemediaguy commentedHi,
I'm not sure how to submit the patch. I am attaching my leech.module file to this post. The only lines that were changed/altered, were 2605 through 2609. I commented in the file so you can find it. Here is what I added to get it working:
Comment #8
alex_b commentedHi Tony,
I just tested your suggestion with OG 2.2 and it does it for me too...
I committed it to the 5.x version ( http://cvs.drupal.org/viewcvs/drupal/contributions/modules/leech/leech.m... )
On a more general note: I am aware that og support is experimental. Specifically we should actually not directly meddle with OG's datastructure (sql statements) but rather manipulate nodes and store them using the node_save() function.
However, the latter approach was always a little too slow for retroactive group changes - that is batch updating huge sets of feed items when you change the group settings on their source feed node.
I would be happy though if somebody came up with a patch that manipulates og settings on a node level in the default setting and provides retroactive changes of group settings with a direct write to the og datastructure only as experimental setting.
I change the status of this thread to fixed.
PS: here is how to submit a patch: http://drupal.org/patch/create
Comment #9
alex_b commentedin 5.x-1.7