Needs review
Project:
Node menus
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Sep 2026 at 08:52 UTC
Updated:
20 Sep 2026 at 08:03 UTC
Jump to comment: Most recent
I'm getting the folowing error :
LogicException: The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution. in file /var/www/html/web/core/lib/Drupal/Core/Database/Connection.php on line 1309
When i use media library or paragraphs widgets to add items.
I traced it down to this module definition of the validation callback in NodeMenusHooks::formNodeFormAlter :
$form['#validate'][] = [$this, 'validateNodeForm'];
which somehow causes the database service to be serialized.
Use static method as validation callback instead of "$this"
$form['#validate'][] = self::class . ':validateNodeForm';
This is very similar to https://www.drupal.org/project/webform/issues/3500726#comment-16295192
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
adel-by commented