Call to undefined method Embed\Embed::create()

Created on 1 November 2020, about 4 years ago
Updated 30 January 2023, almost 2 years ago

Problem/Motivation

Error: "Call to undefined method Embed\Embed::create()"

Steps to reproduce

- Embed library installed using composer require embed\embed
- URL_Embed module installed through GUI
- URL Embed button added to WYSIWYG
- PROBLEM: When pressing insert after copying the URL an ajax error appears. Checking dblog the error is:
Error: Call to undefined method Embed\Embed::create() in Drupal\url_embed\UrlEmbed->getEmbed() (line 47 of /var/www/xxxx/modules/url_embed/src/UrlEmbed.php)

Did I miss something during install? Why it does not find the Embed library? Library is installed because if not the module cannot be enabled.

Thanks!

๐Ÿ’ฌ Support request
Status

Active

Component

Code

Created by

๐Ÿ‡ช๐Ÿ‡ธSpain foreveryo

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 Binoli Lalani Gujarat

    Binoli Lalani โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mark_fullmer Tucson

    You are likely getting this error because of the version of the `embed/embed` library that your codebase is using. Specifically, you describe this step:

    Embed library installed using composer require embed\embed

    Without any other parameters, this would cause version 4 of that library to be added, since that is the latest supported version. In that version, the Embed\Embed::create() method has been removed.

    You indicate that you are using version 8.x-1.0-beta1 of this Drupal module, url_embed, which is compatible with version 3 of embed/embed.

    You can resolve this by the following:

    1. composer remove embed/embed (which will remove the explicitly dependency from your composer.json
    2. Run either composer require drupal/url_embed ^1 -W or composer require drupal/url_embed ^2 -W, which will retrieve either v3 or v4 of embed/embed to match the expected version by the module.

Production build 0.71.5 2024