Problem/Motivation
This error message is displayed on all pages after installing the module
Deprecated function: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated in Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromSharedTables() (line 603 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal 11.1.5
Translatable Menu Link URI 2.1.3
Steps to reproduce
Install the module with composer
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | deprecated_function_unserialize-3555954-10.patch | 596 bytes | mariacha1 |
| #2 | error.png | 182.11 KB | attraktive |
Comments
Comment #2
attraktive commentedComment #3
attraktive commentedComment #4
sokru commentedThis is fixed on core on Drupal 11.x #3300404: Handle nullable serialized field columns, this is due to
link_overrideis not marked as required (so it can be NULL). I'd suggest closing this issue. One can cherry-pick the fix from core issue commit https://git.drupalcode.org/project/drupal/-/commit/4a32768c1632070e1438a..., it shall apply cleanly for latest releases.Comment #5
jsobiecki commented@sokru - Thank you for checking it! I'll double check it and if there are no better option, I'll close this ticket.
Comment #6
jsobiecki commented@sokru - Thank you for checking it! I’ll double-check it, and if there are no better options, I’ll close this ticket.
The upstream fix seems like the best option.
The upstream ticket discussion reports about a workaround, but I didn’t investigate it thoroughly:
https://www.drupal.org/project/drupal/issues/3300404#comment-14974105
Comment #8
jsobiecki commentedComment #10
mariacha1 commentedAttaching a quick Drupal 10-compatible patch here if it's useful for others.
Comment #11
mariacha1 commentedOh, and I also needed this update hook to make sure all the `link_override__options` values where non-null: