From 255ce09e2a1d0056322938387c31f1bdfa28f169 Mon Sep 17 00:00:00 2001 From: Peter Sieg Date: Tue, 14 Apr 2015 15:13:03 +0200 Subject: [PATCH] Issue #457: Support autocomplete when bundle plugin property is ommitted commit 91ee4d9ad1bb4026a28d456e477bf637cac74365 Author: Peter Sieg Date: Wed Apr 1 16:40:32 2015 -0400 Support autocomplete across all bundles of an entity when bundle key was not defined. --- plugins/restful/RestfulEntityBase.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/restful/RestfulEntityBase.php b/plugins/restful/RestfulEntityBase.php index 98b12f32..d90818a3 100644 --- a/plugins/restful/RestfulEntityBase.php +++ b/plugins/restful/RestfulEntityBase.php @@ -205,7 +205,8 @@ protected function getBundlesForAutocomplete() { $info = $this->getEntityInfo(); // When a bundle key wasn't defined return false in order to make the // autocomplete support entities without bundle key. i.e: user, vocabulary. - return !empty($info['entity keys']['bundle']) ? array($this->getBundle()) : FALSE; + $bundle = $this->getBundle(); + return !empty($bundle) && !empty($info['entity keys']['bundle']) ? array($bundle) : FALSE; } /**