I run Drupal with the error level such that strict warnings are shown. On node edit pages I receive the following error:
Strict warning: Only variables should be passed by reference in relation_select_preprocess_views_view_relation_select() (line 38 of /var/www/drupal7/sites/dev.drupal7.local/modules/relation_select/theme/theme.inc).
The following line is the problem:
$entity = reset(entity_load($entity_type, array($entity_id)));
It can be replaced by a useful method supplied by the entity module:
$entity = entity_load_single($entity_type, array($entity_id));
Comments
Comment #1
steveoliver commentedFixed in d3b9627, Jorrit. Thanks.
Comment #2
steveoliver commentedThis introduced the bug #1829538: Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! (now fixed).
Comment #3
8ballsteve commentedThis also adds a dependency on the entity module - worth adding this to the .info file.
Comment #4
steveoliver commented8ballsteve: Good catch. entity_load is provided by core, while entity_load_single is supplied by the Entity module.
Jorrit: Is there a way we can achieve the same functionality without depending on the Entity module?
Comment #5
steveoliver commentedThis should do it:
Going to commit this.
Comment #6
steveoliver commentedRather, let me know how this works for you.
Comment #7
Jorrit commentedLooks good. I thought the Relation module depended on the Entity module, but this isn't the case, sorry.
Comment #8
steveoliver commentedThanks, Jorrit and 8ballsteve. Committed #6 in 3642ae5.