Closed (fixed)
Project:
Relation Select
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2012 at 21:47 UTC
Updated:
1 Dec 2012 at 22:50 UTC
I'm getting the error below when searching items in relation widget.
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of Z:\home\erpal.local\www\includes\entity.inc).
That's because $entity_id is passed in array in entity_load_single function in theme.inc file.
There should be line:
$entity = entity_load_single($entity_type, $entity_id);
instedd of :
$entity = entity_load_single($entity_type, array($entity_id));
Here is my patch:
--- <html>theme.inc (<b>Oct 30, 2012 7:53:32 PM</b>)</html>
+++ <html><b>Current File</b></html>
@@ -35,7 +35,7 @@
else {
$entity_id = $result[$num]->{$view->query->base_field};
$entity_type = relation_select_entity_get_type_from_view($view);
- $entity = entity_load_single($entity_type, array($entity_id));
+ $entity = entity_load_single($entity_type, $entity_id);
$bundle = relation_select_entity_get_bundle($entity_type, $entity);
}
$variables['row_entity'][$num] = array(
Comments
Comment #1
Jorrit commentedentity_load_single()is indeed expecting the second parameter to be just the id. It was actually my fault, see #1807196: Strict warning using reset() on non-variable. Sorry.Comment #2
steveoliver commentedThanks, a.milkovsky. Fixed in 2fe487f.
Comment #3.0
(not verified) commentedfix text