I'd like to link a Drupal node (e.g. content type = 'event' with some custom fields in Drupal) to a CiviCRM event via an entity reference field.
The use case is that there are some events that don't require registration, but some that do, but we want them all to show in the same Events list with the same theming options (these will be pulled in various places on the site in various ways, not just in a calendar list). So: we create all the events in Drupal, and for the ones with registration options, we set up a parallel event in CiviCRM which is linked to the Drupal event by the entity reference field I mentioned at the outset, and we would link with a registration button from the Drupal event directly to the CiviCRM event registration page if there was an entity entered.
I've installed CiviCRM Entity and managed to add a field of type 'entity reference' to the Drupal event node.
I can tell it that this is a CiviCRM event, and asked it to sort on the event's start date in descending order, so that new events would be at the top.
When trying to edit the field (or create an event node if I just leave the field untouched), I get this:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'civicrm_event.event_start_date' in 'order clause': SELECT civicrm_event.id AS entity_id, :entity_type AS entity_type, NULL AS revision_id, :bundle AS bundle FROM {civicrm_event} civicrm_event ORDER BY civicrm_event.event_start_date DESC; Array ( [:entity_type] => civicrm_event [:bundle] => civicrm_event ) in EntityFieldQuery->execute() (line 1192 of /home/public_html/includes/entity.inc).
It looks like the column name in the database should actually be 'civicrm_event.start_date' -- am I right? I grepped in the civicrm_entity folder and didn't see any references to 'event_start_date' in the code, so where should I look next?
UPDATE: As a temporary fix, if I disable sorting it works as expected.