Download & Extend

ability to block Space OG activation on certain paths

Project:Spaces
Version:6.x-3.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

I have the following use case:

- User fills out a form at path og_clone
- On submit, it does a node_load for every node that's in the group you told the system to clone
- it then associates all content to the new group

Here's what happens (was able to track this down to spaces):

- On Submit, group loads correctly and clones
- 1st piece of content node_loads correctly but on node_save it wants to activate the space associated to the original group
- content never associates to the new group because it's technically part of a space already
- loop that's trying to clone everything ends early because of the space activation

The only reason I know this is related to spaces og is that going into spaces_og/plugins/space_og.inc and adding the following to line 148 everything works --

//PATCH to work with elms / og_clone
  if ($_GET['q'] != 'node/add/courses' && arg(0) != 'og_clone' && arg(0) != 'batch') {
    spaces_load('og', current($node->og_groups))->activate();
  }

The issue (i think) with changing the exclude list at the bottom (which has og and og/*) is that og_clone isn't actually loading the node, it's the form submission that is. Is there any way to have logic to say "while on path xyz, don't activate any nodes" without this hack? I couldn't find any and this is necessary functionality when wanting to clone nodes / copy a group from one part of the site to a new part. Anyone attempting to add this functionality to atrium or any other og/spaces/purl based system will experience this issue on copy which is more or less a silent fail from my experience.

At the very least, hopefully this finds someone who has been trying to do this. This also happens on batch jobs so I added in the batch path as well as another one specific to my system which creates nodes on form submit.

Code for og_clone: https://github.com/btopro/elms/tree/master/profiles/elms/modules/elms_co...

Comments

#1

Here's the patch for the Spaces 3.2 version for repairing this for OpenAtrium

#2

patch

AttachmentSize
1280302_fix_activation_issue_for_og_clone.patch 603 bytes

#3

Status:active» closed (duplicate)

#828334: Allow override of PURL excluded_paths, yea?

#4

Status:closed (duplicate)» postponed (maintainer needs more info)

I wish that actually did something. I added those paths to the excluded_paths area manually and it didn't fix the issue. It seemed that it was ok to not load things on that page load but if it's a form that on submit then creates or replicates nodes that are in a group/space that it still activates the group, effectively blowing up the form submission midstream because space gets activated for newly created node and wants to force redirect over to the associated PURL location.

#5

Um, if the other issue is needs work, why does it make this one Needs Info?

#6

This is a two part request it looks like; nodes will redirect to their parent community despite the creation page being disabled. Does like they want to disable that for some? OP: play around with spaces_init.

#7

hmm, ok I'll check out _init when I get a chance. Seemed odd that they would still activate, almost like spaces aren't active for the initial page load but anything called while on that request is ignores the fact that it should be ignoring it :)

nobody click here