Event repeat doesn't play nice with Organic groups: audience settings is not preserved for nodes created according to an eventrepeat pattern ...

I think this could be easily fixed inside eventrepeat itself, but maybe it's the case to build an helper og_eventrepeat module and submit as an og contrib ...

Any idea?

Comments

hunmonk’s picture

please feel free to submit a patch for this additional functionality, as i have no immediate plans or interest in coding it... :)

Luca Lenardi’s picture

Status: Active » Needs review
StatusFileSize
new938 bytes

Patch for enabling og support on repeated events.

Egon Bianchet’s picture

Status: Needs review » Needs work

I think you should unset the old array entries ... to avoid messing up with the node_access table

Luca Lenardi’s picture

StatusFileSize
new1.85 KB

Thank you Egon you are right.
This patch unsets old array entries and also makes eventrepeat able to preserve organic groups when changes on future occurences are applied.

Luca Lenardi’s picture

Status: Needs work » Needs review
hunmonk’s picture

Status: Needs review » Needs work

i'm extremely opposed to conditional code, ie 'if (module_exist)'--i think it leads to a real mess down the road, so i won't put anything in that uses this approach. can you restructure the patch to make this a mini-module that accesses a hook in eventrepeat? if the hooks are done well, then the patch has a good chance of making it in.

also, i don't understand og functionality very well, so i'd need several people to test this patch and provide feedback before i would consider committing it.

Egon Bianchet’s picture

I'd call a hook_eventrepeat_update_nodes in _eventrepeat_update_nodes right before the call to node_save. Modules implementing this hook would return the additions to be saved with the node.

Regarding the patch, I think the code inside _eventrepeat_render_nodes should work inside said hook as well, since that $repeat_data comes straight from the db where it was previously saved by _eventrepeat_update_nodes, right?

hunmonk’s picture

I'd call a hook_eventrepeat_update_nodes in _eventrepeat_update_nodes right before the call to node_save. Modules implementing this hook would return the additions to be saved with the node.

sounds good.

Regarding the patch, I think the code inside _eventrepeat_render_nodes should work inside said hook as well, since that $repeat_data comes straight from the db where it was previously saved by _eventrepeat_update_nodes, right?

this sounds right. i don't have time at the moment to do a thorough check of the code, so you may want to dig in there before you start with the patch... :)

Egon Bianchet’s picture

Status: Needs work » Needs review
StatusFileSize
new935 bytes

Here's a patch implementing the hook ...

Egon Bianchet’s picture

StatusFileSize
new622 bytes

And here's the small module supporting og, however this patch is needed ...

hunmonk’s picture

let's wait until the og module gets that patch or another fix applied before we go ahead with this...

hunmonk’s picture

looks like the og patch was applied. i have a very large UI patch for event repeat that needs to go in before this one, then i'll get to this...

whatistocome’s picture

It's been a month and a half - how close are we to incorporating this patch into eventrepeat?

seanbfuller’s picture

This patch, and current cvs to 4.7 migration in general, is being help up by http://drupal.org/node/69920. Hopefully I'll be able to make some headway on this in the next week.

seanbfuller’s picture

First, apologies for taking so long on this issue. I've posted an alternate solution here. Please test if you get a chance:

http://drupal.org/node/87596

If it does not work, I'll implement the solution outlined above ASAP.

seanbfuller’s picture

Status: Needs review » Closed (fixed)

Since no objections were raised, I committed http://drupal.org/node/87596, which should take care of this issue. Marking this as closed.