Information on 2.x here: http://www.gizra.com/content/og7-and-entity-reference-sponsor-me

There have been major API changes with og and I am willing to work through the changes that will need to take place to get spaces_og in compliance. It is a selfish endeavor to assure our OpenScholar D7 package is up to date.

Any thoughts on the best way to contribute these major changes to the spaces_og.module

Comments

rbrandon’s picture

Issue summary: View changes

correct link target

JohnnyX’s picture

Interested in og combined with spaces_og_forum (which needs spaces...).
Following here...

scottrigby’s picture

Status: Needs work » Active
rbrandon’s picture

StatusFileSize
new3.19 KB

Here is a first pass at a patch which fixes all the major errors/bugs for 'spaces_og' but still needs a bit of refinement. The views still need work as well as some thought about how the group type is going to be handled. Also still need to get to the taxonomy module.

- Richard

Edit: Use next patch, error in this one

rbrandon’s picture

StatusFileSize
new1.72 KB

Re-Made patch, not sure what happened with the last.

rbrandon’s picture

StatusFileSize
new4.75 KB

This fixes the issues with "In Current Space" view filter aka "spaces_handler_filter_spaces_current". And updates the spaces_og code to work with it and dynamically add the necessary og entity_ref relationship.

-Richard

rbrandon’s picture

StatusFileSize
new19.34 KB

Sorry to wait so long to post an updated patch. I updated to the latest dev of spaces and re-created my patch with all of my most current changes. There was still a bit of work to do around private sites and especially the "Spaces current space". Took some testing to get the filter working correctly even when a relationship had not been explicitly added to the view or when multiple "Current Space" filters were used in the same view on different tables.

We have been using this code for a month now without any major bugs, I will update the patch if I find anything else.

-Richard

rbrandon’s picture

Status: Active » Needs review
Renee S’s picture

Thanks, rbrandon! Seems to work for the defaults, although I'm getting an error when I try to create a new preset:

1. Create new Group spaces preset: admin/structure/spaces

2. Receive the following error on create and on save after edit:

Notice: Undefined variable: group_form in _spaces_og_form_spaces_preset_editor_alter() (line 232 of sites/all/modules/contrib/spaces/spaces_og/spaces_og.pages.inc).
Warning: array_intersect_key() [function.array-intersect-key]: Argument #1 is not an array in _spaces_og_form_spaces_preset_editor_alter() (line 232 of sites/all/modules/contrib/spaces/spaces_og/spaces_og.pages.inc).
Notice: Undefined index: og_register in _spaces_og_form_spaces_preset_editor_alter() (line 236 of sites/all/modules/contrib/spaces/spaces_og/spaces_og.pages.inc).
Notice: Undefined index: og_directory in _spaces_og_form_spaces_preset_editor_alter() (line 236 of sites/all/modules/contrib/spaces/spaces_og/spaces_og.pages.inc).
Notice: Undefined index: og_private in _spaces_og_form_spaces_preset_editor_alter() (line 236 of sites/all/modules/contrib/spaces/spaces_og/spaces_og.pages.inc).

There aren't any configuration options showing up under the OG Settings.

3. When I go into an existing preset, I get:

Notice: Undefined variable: group_form in _spaces_og_form_spaces_preset_editor_alter() (line 232 of sites/all/modules/contrib/spaces/spaces_og/spaces_og.pages.inc).
Warning: array_intersect_key() [function.array-intersect-key]: Argument #1 is not an array in _spaces_og_form_spaces_preset_editor_alter() (line 232 of sites/all/modules/contrib/spaces/spaces_og/spaces_og.pages.inc).

Renee S’s picture

Status: Needs review » Needs work
arosboro’s picture

I applied this patch and everything is working. I haven't made any presets, so I haven't run into the issues outlined in #8. One issue I have noticed is that the home page setting on the features tab does not redirect to the path specified when accessing a purl path with no arguments. What are your thoughts on redirecting the root page to the group home page when in a group context.

Also, what is the spaces_current_space filter used for?

arosboro’s picture

StatusFileSize
new508 bytes

Here is my patch to redirect to site_frontpage (set in the features tab) when going to the purl prefix with no arguments.

arosboro’s picture

StatusFileSize
new508 bytes

forgot to close the code block with a curly brace

arosboro’s picture

StatusFileSize
new517 bytes

sorry for the last two patches they were the same. This one works.

arosboro’s picture

Actually, I just found out that this setting can be controlled by going to /features and choosing a different frontpage path than 'frontpage'. I set it to spaces-frontpage and the home page works as designed. The problem with this is that the regular homepage without a purl prefix loads a 404 with spaces-frontpage as the default front page. My patch allows different frontpages for group and site context.

As a side note... frontpage is the path I set for the default homepage view. This is not a drupal default. Ideally the patch should be made to use variable_get and get the value of site_frontpage in the site context. I'm not sure how to accomplish this, as it seems like variable_get only returns the value for the active space.

arosboro’s picture

StatusFileSize
new628 bytes

An example was in API.txt. Here's a modified patch. I'm going to hold off on updating this until I receive some feedback.

socialnicheguru’s picture

patch #6 no longer applies cleanly
is patch from comment 15 supposed to be in lieu of the patch in #6 or in addition to?

arosboro’s picture

patch #15 is not related to 6 it makes the homepage of a group (/modifier) direct to the site_frontpage var value of the current space. Maybe it should have its own issue queue but a previous patch I wrote was merged into 6, so I moved my efforts to this thread.

socialnicheguru’s picture

patch in #6 does not apply to newest dev version

rbrandon’s picture

StatusFileSize
new19.12 KB

I have re-created the newest patch against the latest dev.

amitaibu’s picture

+++ b/spaces_og/plugins/space_og.incundefined
@@ -131,46 +141,49 @@ class space_og extends space_type_purl {
+          if (! empty($node->{OG_AUDIENCE_FIELD}[LANGUAGE_NONE])) {
+            foreach ( $node->{OG_AUDIENCE_FIELD}[LANGUAGE_NONE] as $item ) {

In OG2.x there might be multiple group-audience fields, so you should use og_get_group_audience_fields() or og_is_group_audience_field()

socialnicheguru’s picture

when trying to create a new group preset I get the following:
Notice: Undefined variable: group_form in _spaces_og_form_spaces_preset_editor_alter() (line 232 of spaces/spaces_og/spaces_og.pages.inc).
Warning: array_intersect_key(): Argument #1 is not an array in _spaces_og_form_spaces_preset_editor_alter() (line 232 of spaces/spaces_og/spaces_og.pages.inc).
Notice: Undefined index: og_register in _spaces_og_form_spaces_preset_editor_alter() (line 236 of spaces/spaces_og/spaces_og.pages.inc).
Notice: Undefined index: og_directory in _spaces_og_form_spaces_preset_editor_alter() (line 236 of spaces/spaces_og/spaces_og.pages.inc).
Notice: Undefined index: og_private in _spaces_og_form_spaces_preset_editor_alter() (line 236 of spaces/spaces_og/spaces_og.pages.inc).

socialnicheguru’s picture

fatal error when trying to access user/1/edit/groups

PHP Fatal error: Call to undefined function og_user() in spaces/spaces_og/spaces_og.pages.inc on line 7

jasonawant’s picture

@SocialNicheGuru

Which version are you using? Did you apply the patch in comment 19?

A solution to the first php notice and warning, are found here: http://drupal.org/node/1666692#comment-6688338

Notice: Undefined variable: group_form in _spaces_og_form_spaces_preset_editor_alter() (line 232 of spaces/spaces_og/spaces_og.pages.inc).
Warning: array_intersect_key(): Argument #1 is not an array in _spaces_og_form_spaces_preset_editor_alter() (line 232 of spaces/spaces_og/spaces_og.pages.inc).

I did not see the three other notices when creating a new preset.

Jason.

arosboro’s picture

@SocialNicheGuru re comment #22.

I made a simple page for this menu item that displays a table of subscribed groups and has unsubscribe links. I can contribute this to this patch, and it will resolve your issue.

brucebanner’s picture

StatusFileSize
new18.97 KB

The patch at [#19] did not apply cleanly because it included drupal.org automatic packaging info

@ -15,3 +14,10 @@ files[] = tests/spaces_og.test
 files[] = views/spaces_og.views.inc
 files[] = views/spaces_og_handler_field_og_group_nids.inc
 files[] = views/spaces_og_plugin_argument_validate_useringroups.inc
+
+; Information added by drupal.org packaging script on 2012-02-16
+version = "7.x-3.x-dev"
+core = "7.x"
+project = "spaces"
+datestamp = "1329352606"
+

Rerolled without it.

roysegall’s picture

Status: Needs work » Needs review
StatusFileSize
new19.12 KB

Re-rolling the patch.

roysegall’s picture

StatusFileSize
new13.68 KB

Retry for rolling the patch.

amitaibu’s picture

StatusFileSize
new13.83 KB

Fix WSOD on access check.

socialnicheguru’s picture

http://drupal.org/update/modules/6/7#dbtng

db_fetch* is no longer supported in Drupal 7

spaces/spaces_og/views/spaces_og_handler_field_og_group_nids.inc:45: while ($row = db_fetch_object($result)) {

amitaibu’s picture

zikaelismik’s picture

Hello, i'm having the same issues of undefined index notices (og_private etc) when creating new preset. Also the OG setting panel is empty. If i edit an existing one i don't see any error but still the OG setting panel shows empty.
I've never used these modules before, but i suppose this panel should not be empty.
I'm using Organic Groups 7.x-2.3 and spaces 7.x-3.x-dev and applied the patches in this thread to spaces.

cweagans’s picture

With this patch, spaces_og still depends on og_views. Is that necessary?

cweagans’s picture

Issue summary: View changes

fat fingers

mach5_kel’s picture

Issue summary: View changes

Where is everything at with these patches? I applied the latest one to my own project and just about to test it out.

Any reason this hasent been applied to the latest dev version of spaces?

I am working on a project for a company as well that need spaces and OG 2.

I am willing to check in with them to put some money forth for further development. Either partial, full, etc, depending on what is needed and how much they can afford. Feel free to PM me or respond here. I am not sure what the policy for these things are in the issues queue. However, whatever paid development we get, we are happy to return the code here to be used freely by all.

Thanks!

drupalycious’s picture

Hello,

my test website breaks (blank page, no errors, nothing) as soon as I enable space_og.
I am working with the latest dev version of OG 7.x-2.x

I tried the patch on #28 but I get:
error: patch failed: spaces_og/plugins/space_og.inc:4
error: spaces_og/plugins/space_og.inc: patch does not apply
error: patch failed: spaces_og/spaces_og.info:1
error: spaces_og/spaces_og.info: patch does not apply
error: patch failed: spaces_og/spaces_og.module:269
error: spaces_og/spaces_og.module: patch does not apply
error: patch failed: spaces_og/views/spaces_og.views.inc:34
error: spaces_og/views/spaces_og.views.inc: patch does not apply

thanks

rlnorthcutt’s picture

StatusFileSize
new14.17 KB

Reroll the patch.

rlnorthcutt’s picture

StatusFileSize
new15.02 KB

A better reroll against OG 7.2.7 with the latest dev versions of Spaces and PURL.

However, I am still getting WSOD and an error:
PHP Fatal error: Class name must be a valid object or a string in /var/www/includes/common.inc on line 7870

andy.alexander’s picture

Adding this line:
$this->group_type = "node";

To space_og.inc, right above

    if ($this->id) {
      $this->og = entity_load_single($this->group_type, $this->id);
    }

In the constructor for space_og seems to fix the WSOD.

cweagans’s picture

StatusFileSize
new14.88 KB

Rerolling patch from root of spaces module, setting the default value of $this->group_type per #37.

cweagans’s picture

StatusFileSize
new14.97 KB

One more - fixes a notice when the OG access field isn't attached to the group content type.

blackstallion’s picture

Patch is required for spaces_og.pages.inc line #7. Currently its using D6 og_user (hook_user) instead of newer user api.

djdevin’s picture

StatusFileSize
new14.97 KB
new446 bytes

Still using spaces...

Was using an old patch, and switched to the most recent one. There's another fix to make context work.

grndlvl’s picture

StatusFileSize
new1.55 KB
new15.95 KB

Additional fixes to add support for filtering Taxonomy, User, & Node views.

Fixes activate() to use new 7.x-2.x og_context() call.

grndlvl’s picture

StatusFileSize
new16.9 KB
new1.11 KB

Forgot a couple of things.

Fixing todo to 7.x-2.x OG breadcrumbs()
Adding relation for taxonomy term to fix support for Taxonomy filtering.

dalin’s picture

StatusFileSize
new20 KB

There were some significant issues in the previous patches with Views filters. Joins were being made to 'field_data_' . OG_AUDIENCE_FIELD, but that table is always empty (which is quite the confusing thing with OG2).

This patch fixes things to instead join to og_membership.

dalin’s picture

StatusFileSize
new5.47 KB

Here's an interdiff.