From 9a27ce510fa53eb1812da80c3805a9be9613dc5a Mon Sep 17 00:00:00 2001
From: Helior Colorado <me@helior.info>
Date: Fri, 6 Jan 2012 14:42:14 -0800
Subject: [PATCH] Checking if options module is available before adding
 additional field widgets.

---
 entityreference.module |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/entityreference.module b/entityreference.module
index 2ac8c91..dbc573d 100644
--- a/entityreference.module
+++ b/entityreference.module
@@ -304,8 +304,10 @@ function entityreference_field_widget_info() {
  * Implements hook_field_widget_info_alter().
  */
 function entityreference_field_widget_info_alter(&$info) {
-  $info['options_select']['field types'][] = 'entityreference';
-  $info['options_buttons']['field types'][] = 'entityreference';
+  if (module_exists('options')) {
+    $info['options_select']['field types'][] = 'entityreference';
+    $info['options_buttons']['field types'][] = 'entityreference';
+  }
 }
 
 /**
-- 
1.7.6

