Bug with processEntityIds()

Created on 3 October 2019, about 5 years ago
Updated 18 March 2024, 8 months ago

I found a problem with the "processEntityIds ()" function that returns an error code if the entity is deleted or no longer exists:

TypeError: Argument 1 passed to Drupal\Core\Entity\EntityRepository::getTranslationFromContext() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /var/www/html/web/modules/contrib/entity_browser/src/Element/EntityBrowserElement.php on line 259 in Drupal\Core\Entity\EntityRepository->getTranslationFromContext() (line 99 of core/lib/Drupal/Core/Entity/EntityRepository.php).

🐛 Bug report
Status

Needs review

Version

2.0

Component

Widget plugins

Created by

🇫🇷France Anwoon

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

Comments & Activities

Not all content is available!

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

  • 🇮🇳India soutams

    We are facing the same issue.
    Is there any solution/patch available?
    I'm using Entity Browser 2.9 version.

  • Status changed to Needs review about 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MariaDB 10.3.22
    last update about 1 year ago
    56 pass
  • 🇺🇸United States mediabounds

    We're also encountering this issue essentially with same the steps as in #5 (although for us it as with nodes).

    I'm attaching a slightly different version of the patch in #6.

    When processing the entity IDs, if it encounters one that doesn't exist, it just skips over it. This seems (to me) to be consistent with how Drupal core works on entity reference fields.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.2 & pgsql-14.1
    last update about 1 year ago
    31 pass, 21 fail
  • 🇮🇳India soutams

    @mediabounds,

    https://www.drupal.org/files/issues/2023-10-20/3085476-12.patch after applying this patch the mentioned issue got resolved, but still not able to submit the node. It is giving "media:null" error. Exact error "The referenced entity (media: null) does not exist."

    I'm trying to embed youtube video in an entity reference field. But facing all these issues.

    I'm using Entity Browser 2.9 version.

Production build 0.71.5 2024