When I install the module I always get this error. I couldn't find a way to fix it:

Notice: Undefined index: id in _recurly_entity_relationship_data() (line 137 of modules/recurly/recurly.views.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aepc55 created an issue. See original summary.

markdorison’s picture

Title: Notice: Undefined index: id in _recurly_entity_relationship_data() (line 137 of modules/recurly/recurly.views.inc). » Views integration broken
Issue summary: View changes
Issue tags: -alert, -bug

I am not seeing this specific error, but I am seeing an error when trying to add the recurly relationship to the default "Who's New" view; I am guessing this is related:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'recurly_account.entity_type' in 'on clause': SELECT users_field_data.created AS users_field_data_created, users_field_data.uid AS uid FROM {users_field_data} users_field_data INNER JOIN {users} users ON users_field_data.uid = users.uid LEFT JOIN {recurly_account} recurly_account_users ON users.uid = recurly_account_users.entity_id AND (recurly_account.entity_type = 'user') WHERE (users_field_data.status = :db_condition_placeholder_0) AND ((users_field_data.access > 0)) ORDER BY users_field_data_created DESC LIMIT 5 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 )

markdorison’s picture

Status: Active » Needs review
FileSize
1.87 KB
markdorison’s picture

+++ b/recurly.views.inc
@@ -91,17 +91,17 @@ function recurly_views_data() {
+      $data[$base_table]['recurly_entity_' . $entity_type] = [

@aepc55: I am not sure why this change seems to fix this issue for me, but it seems to. Does this resolve the issue for you?

aepc55’s picture

@markdorison
It worked, thanks for the patch.

markdorison’s picture

Status: Needs review » Reviewed & tested by the community

  • markdorison committed 5a23d71 on 8.x-1.x
    Issue #2887510 by markdorison: Views integration broken
    
markdorison’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

ngunner’s picture

I am still getting this error when I create a view of users and add relationship 'Recurly Account':

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'recurly_account.entity_type' in 'on clause': SELECT users_field_data.uid AS uid FROM {users_field_data} users_field_data INNER JOIN {users} users ON users_field_data.uid = users.uid LEFT JOIN {recurly_account} recurly_account_users ON users.uid = recurly_account_users.entity_id AND (recurly_account.entity_type = 'user') WHERE users_field_data.status = :db_condition_placeholder_0 LIMIT 5 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 )

I have tested the patch in #3 as well as the latest Dev version of the module with no luck. Thank you for any help you can provide.

glynnr’s picture

Apologies up front for re-opening this old issue but couldn't find anything more current.

I also have experienced this error and thought I would share my solution, just in case it helped someone else. Essentially it boils down to how the table alias is being used.

I've attached my patch which I'm running locally and seems to work.