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

Created on 31 March 2015, about 9 years ago
Updated 13 November 2023, 8 months 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 about 6 hours 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.69.0 2024