Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kristiaanvandeneynde’s picture

Could you post the actual error please?

lionslair’s picture

Status: Active » Needs review
FileSize
807 bytes

I think this is the patch for the new file. Someone tell me if it works

lionslair’s picture

FileSize
12.66 KB

Sorry I didn't add the code here it is.

lionslair’s picture

FileSize
13.95 KB

Sorry making a mess of this. Had another class in the same file.

lionslair’s picture

Category: Support request » Feature request
kristiaanvandeneynde’s picture

Okay, but could you post the actual error?

I have made modification so that update now seems to work but I get an error regarding the path module.

lionslair’s picture

Here is the error

Argument 1 passed to GroupController::savePath() must be an instance of Group, instance of stdClass given, called in /home/nathanr/dev/aiswa/web/sites/all/modules/contrib/group/classes/group.controller.inc on line 138 and defined File /home/nathanr/dev/aiswa/web/sites/all/modules/contrib/group/classes/group.controller.inc, line 178

kristiaanvandeneynde’s picture

Status: Needs review » Needs work

Lines like this are your problem: public function import(stdClass $group, stdClass $row) {

You are passing stdClass objects through to Group, where it expects Group, GroupType, GroupMembership, etc. objects.

lionslair’s picture

Issue summary: View changes

I tried changing it to this.

But then it throws the error

 public function import(Group $group, stdClass $row) {

Fatal error: Declaration of MigrateDestinationGroup::import() must be compatible with MigrateDestination::import(stdClass $object, stdClass $row)

kristiaanvandeneynde’s picture

The problem is you are changing the signature of import() in your child class compared to import() in the parent class. Seeing as Migrate insists on receiving a stdClass object, while Group insists on receiving a Group object, I suggest you gather the values needed and pass em on as $values to entity_create('group', $values) which you can then save.

It's annoying, but having the Group restriction in the function signatures fixes a lot of potential bugs by throwing a fatal error when you are trying to do Group stuff on a non-Group object. From a first glance, I don't know why Migrate insists on stdClass, though.

Soul88’s picture

Status: Needs work » Closed (outdated)

We thank everyone for their collaboration on this issue, but as the D7 version is no longer supported, we will now close all D7 issues to keep the issue queue a bit tidier. This information won't go anywhere, it just won't show up on the list of open issues anymore.

Please see: https://www.drupal.org/project/group/issues/3163655 and https://www.drupal.org/project/group/issues/3203863#comment-14100281 for more details.