Serializing the database connection is dangerous and error-prone, make it unserializable again

Created on 31 March 2015, over 9 years ago
Updated 13 November 2023, about 1 year ago

Problem/Motivation

The SQLite and PostreSQL database drivers are doing some important things in their connection object constructor (e.g. altering the db prefix for SQLite, executing 'init_commands' for PostgreSQL) but Drupal\Core\Database\Connection::unserialize() is only doing the job of its own constructor by duplicating the code.

Proposed resolution

Call the connection object constructor instead of forcing each driver to duplicate its code.

Remaining tasks

Review, commit.

User interface changes

Nope.

API changes

Nope.

🐛 Bug report
Status

Fixed

Version

8.0 ⚰️

Component
Database 

Last updated 3 days ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇷🇴Romania amateescu

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.

Production build 0.71.5 2024