See: #1170508: Kill $predicate!

$predicate has been renamed to $relation_type so subuser.install needs a minor change to install properly. I haven't figured out if and where other changes are neccessary. I will update this if I run into further problems. For now I only got the installation working, I think this renaming might have more impacts on other places.

The error message you will get during install is:

    Notice: Trying to get property of non-object in relation_type_save() (line 303 of .../htdocs/sites/all/modules/contrib/relation/relation.module).
    Notice: Trying to get property of non-object in relation_type_save() (line 304 of .../htdocs/sites/all/modules/contrib/relation/relation.module).
    Notice: Trying to get property of non-object in relation_type_save() (line 305 of .../htdocs/sites/all/modules/contrib/relation/relation.module).
    Warning: Invalid argument supplied for foreach() in relation_type_save() (line 317 of .../htdocs/sites/all/modules/contrib/relation/relation.module).
    Notice: Trying to get property of non-object in relation_type_save() (line 321 of .../htdocs/sites/all/modules/contrib/relation/relation.module).
    FieldException: Attempt to create an instance of field endpoints without a bundle. in field_create_instance() (line 460 of .../htdocs/modules/field/field.crud.inc).

Patch will be enclosed in comment below so it can be namend correctly after having an issue number.

Comments

marcusx’s picture

An here is the patch...

dandaman’s picture

Thanks for the patch! In my testing, it does remove those errors, but if you go to Admin->Structure->Relation Types, it still doesn't show the relation there. So something's still not working, IMHO.

Also, for the subuser administration, the view for the subuser management no longer works because of changes in Views Bulk Operations. I'll be posting the view when I have it working in another thread.

Juan C’s picture

Subscribe

Nigeria’s picture

Any news on this. Urgently needed

Ingmar’s picture

It works for me. You have to apply the patch to the code and reinstall the module.
Thank you marcusx

Nexotap’s picture

I dont think it works with only that change.

In the install file and in the module there is a call to:
relation_create('subuser', $endpoints); and
relation_type_create('subuser', $endpoints);

Only this isnt working anymore. You have to save it as well. Here's what I've changed:

// In subuser.install
//    relation_type_create($record);
  relation_type_save(relation_type_create($record));

// In subuser.module
//    relation_create('subuser', $endpoints);
  relation_save(relation_create('subuser', $endpoints));

Also the views_bulk implementation in views has changed and is not working anymore. But this i havent fixed yet.

Dont blame me, if I cant provide any patch for this, since me and patch are not swimming in the same river.

I hope, my 5 cents have still helped a bit here.

Nexotap’s picture

You can blame me any way.
I've just looked trough the issues and found out, that those things are fixed already.

Maybe somone wants to close this issue, since it duplicates problems aready solved.

roderik’s picture

Status: Needs review » Reviewed & tested by the community

#1 isn't already solved, and works.

And there is nothing else in the module that needs to be changed.

bluesky_still’s picture

I met this problem/

boombatower’s picture

Category: bug » task
Priority: Critical » Normal
Status: Reviewed & tested by the community » Fixed

Committed thanks.

Since this is a dev release an it is an API change a little hard to call it a bug. Thanks for the patch. We should probably look into making this exportables instead.

boombatower’s picture

Went ahead and converted it to use exportables API.

Status: Fixed » Closed (fixed)

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

Paul B’s picture

Version: 7.x-2.x-dev » 7.x-2.0-alpha2
Status: Closed (fixed) » Active

It doesn't work yet:

$ drush dl drupal
$ cd drupal-7.22/
$ drush site-install --yes --db-url=sqlite://sites/default/files/ht.sqlite --site-name='test'
$ drush dl subuser
Project subuser (7.x-2.0-alpha2) downloaded to /home/paul/test/drupal-7.22/sites/all/modules/subuser.                                                     [success]
Project subuser contains 2 modules: subuser_switch, subuser.
$ drush en subuser --yes
The following projects have unmet dependencies:
subuser requires views_bulk_operations, views, relation
Would you like to download them? (y/n): y
Project views_bulk_operations (7.x-3.1) downloaded to /home/paul/test/drupal-7.22/sites/all/modules/views_bulk_operations.                                [success]
Project views_bulk_operations contains 2 modules: views_bulk_operations, actions_permissions.
Project views (7.x-3.7) downloaded to /home/paul/test/drupal-7.22/sites/all/modules/views.                                                                [success]
Project views contains 2 modules: views_ui, views.
Project relation (7.x-1.0-rc4) downloaded to /home/paul/test/drupal-7.22/sites/all/modules/relation.                                                      [success]
Project relation contains 6 modules: relation_dummy_field, relation_entity_collector, relation_migrate, relation, relation_endpoint, relation_ui.
The following projects have unmet dependencies:
subuser requires entity, ctools
Would you like to download them? (y/n): y
Project entity (7.x-1.1) downloaded to /home/paul/test/drupal-7.22/sites/all/modules/entity.                                                              [success]
Project entity contains 2 modules: entity, entity_token.
Project ctools (7.x-1.3) downloaded to /home/paul/test/drupal-7.22/sites/all/modules/ctools.                                                              [success]
Project ctools contains 9 modules: ctools_access_ruleset, ctools_plugin_example, stylizer, bulk_export, views_content, page_manager, ctools_custom_content, ctools_ajax_sample, ctools.
The following extensions will be enabled: subuser, entity, views_bulk_operations, ctools, views, relation_endpoint, relation
Do you really want to continue? (y/n): y
Invalid argument supplied for foreach() relation.module:273                                                                                               [warning]
WD php: FieldException: Attempt to create an instance of field endpoints without a bundle. in field_create_instance() (line 481 of                        [error]
/home/paul/test/drupal-7.22/modules/field/field.crud.inc).
Cannot modify header information - headers already sent by (output started at /home/paul/drush/includes/output.inc:37) bootstrap.inc:1212                 [warning]
FieldException: Attempt to create an instance of field endpoints without a bundle. in field_create_instance() (line 481 of /home/paul/test/drupal-7.22/modules/field/field.crud.inc).
Drush command terminated abnormally due to an unrecoverable error.
akalata’s picture

Hoping to consolidate the number of issues on install, I've marked the following as duplicates:
#1992226: Errors on installation
#1903884: Buggy code in install file
#1436248: Unable to uninstall

akalata’s picture

Issue summary: View changes

Added the error message you get during install, so if someone searches for it the issue is easily found.

lauriii’s picture

Version: 7.x-2.0-alpha2 » 7.x-2.0-alpha3
Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

Can't reproduce

  • Commit 0d9c64e on 7.x-2.x, 8.x-1.x by boombatower:
    Issue #1241934 by marcusx: Update relation definition for relation...