Hi,
After I deleted a previous relation type. I created new one.
since then I get the warning:

Notice: Trying to get property of non-object in relation_entity_collector() (line 138 of C:\wamp\www\drupal\sites\all\modules\relation\relation_entity_collector\relation_entity_collector.module).
Warning: Invalid argument supplied for foreach() in relation_entity_collector() (line 138 of C:\wamp\www\drupal\sites\all\modules\relation\relation_entity_collector\relation_entity_collector.module).
Notice: Trying to get property of non-object in relation_entity_collector() (line 138 of C:\wamp\www\drupal\sites\all\modules\relation\relation_entity_collector\relation_entity_collector.module).
Warning: Invalid argument supplied for foreach() in relation_entity_collector() (line 138 of C:\wamp\www\drupal\sites\all\modules\relation\relation_entity_collector\relation_entity_collector.module).
Notice: Trying to get property of non-object in relation_entity_collector() (line 138 of C:\wamp\www\drupal\sites\all\modules\relation\relation_entity_collector\relation_entity_collector.module).
Warning: Invalid argument supplied for foreach() in relation_entity_collector() (line 138 of C:\wamp\www\drupal\sites\all\modules\relation\relation_entity_collector\relation_entity_collector.module).
Notice: Trying to get property of non-object in relation_entity_collector() (line 138 of C:\wamp\www\drupal\sites\all\modules\relation\relation_entity_collector\relation_entity_collector.module).
Warning: Invalid argument supplied for foreach() in relation_entity_collector() (line 138 of C:\wamp\www\drupal\sites\all\modules\relation\relation_entity_collector\relation_entity_collector.module).

Any ideas?

Comments

agerard’s picture

I'm also having many of these errors and they seem to multiply despite - or because of - my module removal/uninstall/re-enabling attempts. Which leads me to suspect data is not being purged. Someone suggested installing dev for a better uninstall, which I may try soon...other suggestions (so I could actually use the module rather than delete it!) would be much appreciated.

chx’s picture

Status: Active » Postponed (maintainer needs more info)

I need to know more. Can you dump your relation types with the bulk export module that comes with ctools and attach it as a .txt file to the issue? You clearly have a broken relation type I am just not sure how it happened.

Thanks for using the relation module and reporting bugs!

chx’s picture

Priority: Critical » Normal
fashionary’s picture

subscribe

sapiusenator’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev
StatusFileSize
new579 bytes

7.x-1.0-rc2+40-dev
Deleted all Entity Types and Rules then created one relation type source: User, changed no settings (only set label and machine name) and clicked save
############
Notice occurs on Relation Type: creation/manage fields/save edit/view user page/edit (tested with relation type on node bundle and view node causes error as well); causes multiple notices:
Notice: Trying to get property of non-object in relation_entity_collector() (line 138 of /var/www/vhosts/myblogbeat.com/httpdocs/sites/all/modules/relation/relation_entity_collector/relation_entity_collector.module).

on edit display settings:
Notice: Undefined index: view_modes in relation_endpoint_field_formatter_settings_summary() (line 218 of /var/www/vhosts/myblogbeat.com/httpdocs/sites/all/modules/relation/relation_endpoint.module).

attached: /admin/structure/relation/manage/RELATION_TYPE/export

richshaw101’s picture

I was also having this problem. It seemed to be caused by deleting a relation type and uninstalling / re-installing the module. I took a look at the section of code which was causing the problem in the relation_entity_collector.module and it was calling $relation_type = isset($_SESSION['relation_type']) ? $_SESSION['relation_type'] : '';

I'm guessing that $_SESSION['relation_type'] isn't unset when you uninstalling / re-install the module and the entity collector is looking for a relationship type that no longer exists.

I just unset the session variable and it got me back up and running.

unset($_SESSION['relation_type']);
zarne’s picture

I also have that problem in relation-7.x-1.0-rc3, but I do not know where I have to set in your peace of code?

mikran’s picture

Assigned: Unassigned » mikran
Status: Postponed (maintainer needs more info) » Needs work
mikran’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests
StatusFileSize
new1.61 KB

Does this fix the issue you're having?

zarne’s picture

I have uninstalled Relation, and use Entity reference for now. But will test it next time I install that great module

desierto’s picture

I also get these errors. I did uninstall and reinstall the module as well. The 'entity collector' or 'relation add' will no longer see any entities on the page, even when the appropriate entities are loaded.

mikran’s picture

Assigned: mikran » Unassigned
Status: Needs review » Fixed

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