Deprecated PHP warning for Embeddings module, from

Created on 7 May 2023, over 1 year ago
Updated 23 May 2023, over 1 year ago

It is possible something in my setup is sending a null value where it should not, but this is a proof of concept using a simple example.

Deprecated function: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\openai_embeddings\Plugin\QueueWorker\EmbeddingQueueWorker->processItem() (line 135 of modules/contrib/openai/modules/openai_embeddings/src/Plugin/QueueWorker/EmbeddingQueueWorker.php).
Drupal\openai_embeddings\Plugin\QueueWorker\EmbeddingQueueWorker->processItem(Array) (Line: 183)
Drupal\Core\Cron->processQueues() (Line: 139)
Drupal\Core\Cron->run() (Line: 75)
Drupal\Core\ProxyClass\Cron->run() (Line: 167)
Drupal\system\Form\CronForm->runCron(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('system_cron_settings', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)

But this appears to be because of this error:
Warning: DOMDocument::loadHTML(): Tag drupal-media invalid in Entity, line: 1 in Drupal\openai\Utility\StringHelper::prepareText() (line 48 of modules/contrib/openai/src/Utility/StringHelper.php).
Drupal\openai\Utility\StringHelper::prepareText('​...

Which would mean the dom parser does not like the 'drupal-media' tag. However, this tag will appear in media-enabled sites with wysiwyg media embedding, right?
Is there a way to reduce the strictness of the parser, maybe?

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bob.hinrichs

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

Comments & Activities

Production build 0.71.5 2024