Deprecated: strpos(): Non-string needles will be interpreted as strings in the future.

Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\Component\Plugin\PluginBase->getDerivativeId() (line 83 of core/lib/Drupal/Component/Plugin/PluginBase.php).

Comments

jcontreras created an issue. See original summary.

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs steps to reproduce

This indicates the plugin has no ID. Which plugin is this?

cilefen’s picture

Component: asset library system » plugin system
jcontreras’s picture

Status: Postponed (maintainer needs more info) » Active
Issue tags: -Needs steps to reproduce
StatusFileSize
new1.02 KB

strpos() is requiring the variable to be a string. The problem happened after updating to PHP 8.1

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

Understood. But which plugin is this? Many people have offered similar workaround patches but there is a problematic plugin here.

cilefen’s picture

jcontreras’s picture

StatusFileSize
new810.46 KB

I see what you mean. I had it print out the ID's and turns out if I am not mistaken, that the "entity_embed" plugin is returning "NULL" for the id.

id null

cilefen’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)
Related issues: +#3260833: Construction of EntityEmbedDisplay plugin instances trigger strpos deprecation on PHP 8.1

It is fixed but not yet released.

jcontreras’s picture

Perfect thank you!

binnythomas’s picture

I am getting the same error on Drupal core 9.3.22 and this patch fixes the issue. Any idea in which release this is incorporated?

cilefen’s picture

@binnythomas This one was caused in the Entity Embed project, not Core.