Problem/Motivation
Wrong instance passed to the constructor of SocialEmbedHelper.
TypeError: Argument 1 passed to Drupal\social_embed\Service\SocialEmbedHelper::__construct() must be an instance of Drupal\Component\Uuid\Php, instance of Drupal\Component\Uuid\Pecl given in Drupal\social_embed\Service\SocialEmbedHelper->__construct()
SocialEmbedHelper expects Drupal\Component\Uuid\Php class because that is what core service "uuid" offers.
Because of compatibility there is a service alter on CoreServiceProvider::alter that checks for existing functions and this can lead to a different class injection at SocialEmbedHelper
$uuid_service = $container->getDefinition('uuid');
// Debian/Ubuntu uses the (broken) OSSP extension as their UUID
// implementation. The OSSP implementation is not compatible with the
// PECL functions.
if (function_exists('uuid_create') && !function_exists('uuid_make')) {
$uuid_service->setClass('Drupal\Component\Uuid\Pecl');
}
// Try to use the COM implementation for Windows users.
elseif (function_exists('com_create_guid')) {
$uuid_service->setClass('Drupal\Component\Uuid\Com');
}Steps to reproduce
Just enable SocialEmbed
Proposed resolution
Change the expected class from Drupal\Component\Uuid\Php to Drupal\Component\Uuid\UuidInterface
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Comments
Comment #2
tbsiqueiraPR: https://github.com/goalgorilla/open_social/pull/2649
Comment #3
tbsiqueiraComment #6
tbsiqueira