Although this module removes the Views dependency on SQL, it still assumes that the data store is local. This is problematic when attempting to display remote entities (using the Remote Entity API) through Views.

Here are some of the issues I've run into while putting this solution together for a client:

  • Multiple Web service calls are made (one to get the entity IDs and one to fully load them) when only one is necessary.
  • EntityFieldQuery objects are always used for query building. At present, RemoteEntityQuery objects (necessary to query for remote data through the Remote Entity API) are not supported.

I'll post a patch shortly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

colan’s picture

Status: Active » Needs review
FileSize
4 KB

This patch assumes the existence of RemoteEntityQuery::buildFromEFQ(), to convert an EFQ, which should be implemented in the RemoteEntityQuery subclass specific to the implementation.

I'll create a documentation issue in the Remote Entity API queue explaining how it should work, and then I'll relate it to this ticket.

  • Commit 0aca971 on 7.x-1.x by colan:
    Issue #2283083 by colan: Add support for remote entities via Remote...
colan’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

Murz’s picture

Thanks for the patch, but can you provide some example how to work with this, or maybe example module?

I create new entity type "mycustomentitytype" and new view for this entity type, but it shows me the error:
Entity mycustomentitytype has no base table.

This entity uses remote storage (via REST api), so no local drupal table used.

Same problem is when I try to use direct code:

  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'mycustomentitytype')
    ->propertyCondition('id', 1);
  
  $result = $query->execute(); 
Error message
EntityFieldQueryException: Entity <em class="placeholder">mycustomentitytype</em> has no base table. in EntityFieldQuery->propertyQuery() (line 1213 of includes/entity.inc).
colan’s picture

@Murz: Please don't hijack closed bugs/features with support requests. Instead, open a Support Request ticket.

The blog post Integrating remote data into Drupal 7 and exposing it to Views may help you.