- Issue created by @oskar_calvo
- π©πͺGermany antares89 Schwerin
Hey,
I also had this error. With a Drupal 10.1.5 and Tome 1.13
I noticed ObjectAwareSerialization was added with Drupal 11. Tome 1.13 adds Drupal 11 compatibility.
After I downgraded Tome to 1.12 it worked again with Drupal 10. - πΊπΈUnited States patrick.thurmond@gmail.com Overland Park, KS
Changing versions does not solve this. There is a problem where the PhpSerialize class is SUPPOSED to be implementing this ObjectAwareSerializationInterface in core but it is not. (ref: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Seri...)
When you actually look at this code in Drupal 10 core.
So instead of accepting THAT particular interface, you can fallback to just the "SerializationInterface" interface. And the reason being is that the new interface extends this interface. So it SHOULD allow for any that inherit from it.
To fix this you need to change this file:
In it add the following use statement at the top:
use Drupal\Component\Serialization\SerializationInterface;
Then change the constructor to say:
/** * Constructs a StaticCache object. * * @param \Drupal\Core\Database\Connection $connection * The database connection. * @param \Drupal\Core\Cache\CacheTagsChecksumInterface $checksum_provider * The cache tags checksum provider. * @param \Drupal\Component\Serialization\SerializationInterface|int|string|null $serializer * (optional) The serializer to use. * @param \Drupal\Component\Datetime\TimeInterface|int|string|null $time * The time service. */ public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, SerializationInterface $serializer, TimeInterface $time) { DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.0.0', fn() => parent::__construct($connection, $checksum_provider, 'tome_static', $serializer, $time, self::MAXIMUM_NONE), fn() => parent::__construct($connection, $checksum_provider, 'tome_static', self::MAXIMUM_NONE) ); }
I am able to enable the module now AND run the static generator. I will work to create a patch to submit later after I get done dealing with the fire this caused with our failover system.
- πΊπΈUnited States patrick.thurmond@gmail.com Overland Park, KS
Ok, here is my patch.
- πΊπΈUnited States patrick.thurmond@gmail.com Overland Park, KS
I will point out that my site is on Drupal 10.2.10.
In Drupal 9.5 the PhpSerialize class implements the "SerializationInterface".
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Seri...
This is apparently still the case until Drupal 10.3.x.
For maximum compatibility I recommend implementing my solution.