Added a check for the fields primary storage column as it's not always 'value'

The findBy method assumed a field 'value' for storage. This change gets the primary column for the field and checks that instead.
The key column is available in hook_entity_info or the alter function

Stewart Robinson

Office: +44 (0)207 099 3875
Mobile: +44 (0)7909696038
@stewsnooze

Mission critical Drupal.
Lower total cost of ownership.

FullFatThings.com


> On 15 Jul 2014, at 16:30, Dan Ashdown <notifications@github.com> wrote:
> 
> In entity_decorator_finder.class.inc:
> 
> >      if (count($value)) {
> >        // Is the field a property?
> >        if ($this->isProperty($field_name)) {
> >          $this->query->propertyCondition($field_name, $value, $operator);
> >        }
> > +      else if (isset($field_info['columns'])) {
> > +        $this->query->fieldCondition($field_name, current(array_keys($field_info['columns'])), $value, $operator);
> Observation, looking at link and term fields. EFQ isn't very good with OR so couldn't use all columns, unless we have an additional param that overrides the column choice. e.g. find_by_field_somefield('www.google.com', 'url');
> 
> —
> Reply to this email directly or view it on GitHub.