I have a few OG groups that are taxonomy terms - I was writing a migration script to migrate some nodes from a D6 install to a D7 one, Everything was going swell until I tried to set the audience of the migrated nodes. I got an error, something along the lines of:

WD node: MigrateException: array_values() expects parameter 1 to be array, null given                                                              [error]
File /Users/chris/Sites/grammypro/docroot/profiles/commons/modules/contrib/commons_groups/commons_groups.module, line 759 in
MigrationBase->errorHandler() (line 530 of /Users/chris/Sites/grammypro/docroot/sites/all/modules/contrib/migrate/includes/base.inc).
array_values() expects parameter 1 to be array, null given                                                                                         [error]
File /Users/chris/Sites/grammypro/docroot/profiles/commons/modules/contrib/commons_groups/commons_groups.module, line 759

I checked out the code in question and saw that it was because the node that I was migrating, its author, had not contributed to this group before, and so the commons_groups_first_contribution() method was called. That method only cares about groups that are just nodes. I'm using taxonomy terms as the entities for some groups (in addition to node-groups).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

svajlenka’s picture

EDIT: I failed at patch creation :(
I cooked up this patch, but someone with more intimate knowledge of OG or commons might want to clean it up to be more all encompassing for entities rather than just nodes and taxonomy terms.

svajlenka’s picture

Forgot to rebase before patch creation. :]

svajlenka’s picture

Oh wow, now I just feel all sorts of dumb, I was attaching the wrong file.

ezra-g’s picture

Status: Active » Needs work

Looks like this was never marked as "needs review" and so it didn't get a review.

An initial inspection of the code shows that it needs to be re-rolled because it does not comply with the Drupal coding standards.