This module currently doesn't work with the newer and likely to be more widely used going foward 7.x-2.x version of the OG module because of changes to the way that the $group entity is loaded.

Without this patch if you enable the module on a site using og-7.x-2.x you can add the group theme field to you group content type however when you try and visit the group page you'll get a PHP error. This converts og_theme_custom_theme() to use entity_load_single() instead of $group->getEntity(); which is causing problems here.

I've also re-named the $group variable to $context and the $entity variable to $group as it makes what's going on here clearer.

You might also want to roll a new release of the module with this patch applied and tag it 7.x-2.x so that it's clear this version is for use with og-7.x-2.x.

Comments

netw3rker’s picture

This patch appears to have a hard dependency on og_context module. be sure to update the .info file to denote that, otherwise sites that dont have that enabled will WSOD after applying the patch.

Crell’s picture

Priority: Major » Critical
Status: Needs review » Reviewed & tested by the community

That hard dependency was there already. That should be a separate issue.

I've confirmed that this patch does work with the latest tagged OG release, though. Bumping to critical since a fatal is, in fact, critical. :-)

Agreed with the OP that a new branch is probably wise.

amitaibu’s picture

Status: Reviewed & tested by the community » Fixed

I've changed a bit the patch to use entity_metadata_wrapper(), and created a new branch.
Please give me an ok on the committed patch, and I'll roll a stable release.

Crell’s picture

I just checked out the 2.x branch in my local test site and it worked swimmingly. No errors. I'd say it's stable ready.

yay!

amitaibu’s picture

Thanks Larry, created new release -- http://drupal.org/node/1699650

Status: Fixed » Closed (fixed)

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