entity_lookup plugin fails if $value is empty

Created on 23 November 2016, over 8 years ago
Updated 25 July 2024, 8 months ago

I am using entity_lookup plugin at the end of a pipeline. Some of my entries do not have a value.

What I'm finding is that even if I use skip_on_empty or any other process plugins NONE of them even bother to run because the error is tripped during the construct phase, before the pipeline has even had a chance to run.

So essentially this plugin tries to set itself up before it even knows if it will be needed or not.

I found the problem is triggerd in the query method. Fortunately I know if the value is empty at the start of the query so I can simply not build the query object in that case. So I am starting the query method in entity_lookup with the following:

    if (empty($value)) {
      return NULL;
    }

...and now everything in the pipeline works as expected.

Earlier in my debugging process I found that if I did not run parent::__construct that would get me further along, but the above code seems to be a much better for now in my case.

πŸ› Bug report
Status

Needs review

Version

6.0

Component

Plugins

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024