I updated to the latest dev with some existing relation types and I now get the following Notice when I visit the 'manage display' (admin/structure/relation/manage/employed_by/display) page for any relation type:

Notice: Undefined index: view_modes in relation_endpoint_field_formatter_settings_summary() (line 213 of /home/dm7/sites/example.ca/modules/contrib/relation/relation_endpoint.module).

If I try and view a particular relation I get three messages and the endpoints are not displayed:

Notice: Undefined index: view_modes in relation_endpoint_field_formatter_view() (line 241 of /home/dm7/sites/example.ca/modules/contrib/relation/relation_endpoint.module).

Notice: Undefined variable: endpoints in relation_endpoint_field_formatter_view() (line 269 of /home/dm7/sites/example.ca/modules/contrib/relation/relation_endpoint.module).

Warning: Invalid argument supplied for foreach() in relation_endpoint_field_formatter_view() (line 269 of /home/dm7/sites/example.ca/modules/contrib/relation/relation_endpoint.module).

I have run updatedb and cleared caches multiple times.

Here is an export of one of my relations just in case it helps:

$relation_type = new stdClass;
$relation_type->disabled = FALSE; /* Edit this to true to make a default relation_type disabled initially */
$relation_type->api_version = 1;
$relation_type->relation_type = 'employed_by';
$relation_type->label = 'Employed by';
$relation_type->reverse_label = 'Employed by';
$relation_type->directional = 1;
$relation_type->transitive = 0;
$relation_type->r_unique = 1;
$relation_type->min_arity = 2;
$relation_type->max_arity = 2;
$relation_type->source_bundles = array(
  0 => 'user:user',
);
$relation_type->target_bundles = array(
  0 => 'organization:*',
);

Comments

acrazyanimal’s picture

Anyone else having this issue?

rlmumford’s picture

I have a similar problem on the relation view page. When I go to the view the relation i see the following errors:

Notice: Undefined variable: endpoints in relation_endpoint_field_formatter_view() (line 269 of /home/wtcstaging/public_html/sites/all/modules/relation/relation_endpoint.module).
Warning: Invalid argument supplied for foreach() in relation_endpoint_field_formatter_view() (line 269 of /home/wtcstaging/public_html/sites/all/modules/relation/relation_endpoint.module).
$relation_type = new stdClass();
$relation_type->disabled = FALSE; /* Edit this to true to make a default relation_type disabled initially */
$relation_type->api_version = 1;
$relation_type->relation_type = 'hub_course';
$relation_type->label = 'offers';
$relation_type->reverse_label = 'is available at';
$relation_type->directional = 1;
$relation_type->transitive = 0;
$relation_type->r_unique = 1;
$relation_type->min_arity = 2;
$relation_type->max_arity = 2;
$relation_type->source_bundles = array(
  0 => 'node:hub',
);
$relation_type->target_bundles = array(
  0 => 'course:course',
);
rlmumford’s picture

I also get the error on the view modes page

franz’s picture

I had this after upgrading from beta2 to rc2

BrandonCapitalism’s picture

I as well.

onomated’s picture

Same here: Relation 7.x-1.x-beta1

nickvidal’s picture

Me too. Even on a fresh install.

sheldonkemper’s picture

Same problem with Relations 7.x-1.0-rc2

mikran’s picture

Title: view_modes not working after updating to latest dev » Endpoints table field formatter settings are broken

#2 is not related to this issue.

In addition to settings I found more problems with the relation endpoints table. relation/% displays endpoints correctly with 'Full entities list' formatter but with endpoints table just the label is displayed.

Chris Gillis’s picture

It seems this might be a duplicate of http://drupal.org/node/1450794, but I'm not entirely sure, so hesitate to mark it as such.

bunthorne’s picture

I got the error with Relation rc2 and D7.14. I followed #10 and updated to Relation dev, but problem is still there.

Notice: Undefined index: view_modes in relation_endpoint_field_formatter_settings_summary() (line 213 of -snip- /sites/all/modules/relation/relation_endpoint.module).

marcusx’s picture

I opened a new issue #1563678: Endpoints table formatter is displaying label only for the additional problem (table not showing up) described in #9 and uploaded a patch to fix this.

mikran’s picture

Status: Active » Needs review
StatusFileSize
new493 bytes

simple fix

mikran’s picture

Status: Needs review » Needs work

While testing #1606736: Relation incorrectly assumes that all entity types have a entitytype_view() function I found more issues with ECK entities: "Notice: Undefined index: eck_employee in relation_endpoint_field_formatter_settings_summary() (line 221 of /.../relation/relation_endpoint.module).". relation_endpoint_field_formatter_view() defaults view_mode to 'full' if not set so I believe the same approach would be the working solutions for this settings form as well.

Chris Gillis’s picture

Confirm #13 appears to work (error disappears)

Johnny Jackson’s picture

Added both patches identified in this thread and all of my errors have gone away. Thanks

mikran’s picture

Those errors look like errors from rc2, try with the latest dev and this patch.

I'll try to find time this weekend to fix this properly

mikran’s picture

Assigned: Unassigned » mikran
scottrigby’s picture

Status: Needs work » Reviewed & tested by the community

@mikran that looks right. From the documentation of hook_field_formatter_info(), this matches the settings in relation_endpoint_field_formatter_settings_form() (as defined in relation_endpoint_field_formatter_view()). AFAICT no refactoring is needed =)

mgifford’s picture

Any ideas about bringing this patch from June into the repository?

chx’s picture

Status: Reviewed & tested by the community » Fixed
mgifford’s picture

Thanks @chx!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

originally made a mistake with messages