Problem/Motivation

In #2551549: Deprecate per-table prefixing we deprecated the use of per-table prefixes under multisite.

Since this behavior will be unsupported in Drupal 9, users should get early warning if their site is based on this technique during the Drupal 8 lifecycle.

Proposed resolution

Add a hook_requirements() warning that this type of table sharing will go away soon.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#3 3022403_3.patch583 bytesmile23

Issue fork drupal-3022403

Command icon Show commands

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

Mile23 created an issue. See original summary.

mile23’s picture

See comments about dropping support for per-table prefixes, which prompted the creation of this issue: #3004496: Document best practices for multisite and composer

mile23’s picture

StatusFileSize
new583 bytes

As a minimum first step, linking to the CR.

mile23’s picture

Issue tags: +@deprecated
berdir’s picture

Adding a trigger_error() should be easy, just check for it being an array.

That said, that would result in dozens/hundreds of those deprecation messages for anyone who actually has that, because if it happens, it is a global sitewide thing that won't be easy to get rid of, you can't just update some code but likely have to rearchitecture your site. Assuming someone actually managed to make this work reliable, which I very much doubt, which is why we deprecated it in the first place.

Given that, not quite sure if a @trigger_error() is the right approach here. Maybe a requirements hook similar to the php version would make more sense?

mile23’s picture

Title: Figure out how to @trigger_error() for per-table prefix in multisite » Warn users about per-table prefix in multisite during requirements hook
Issue summary: View changes

Diggit. Updated IS.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mondrake’s picture

Priority: Normal » Major
Issue tags: +blocker

Per-table prefix is theoretically deprecated since 8.2.0, but not enforced practically. That would be done by #3106531: Notify in Status Report that per-table database prefixes are no longer supported, and will throw errors in Drupal 10.0, which is now postponed on this issue.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

andypost’s picture

I think about warning message at status page
It could be done in this issue for 9.2
To unblock #3106531: Notify in Status Report that per-table database prefixes are no longer supported, and will throw errors in Drupal 10.0 for 9.3.x

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

daffie’s picture

Status: Active » Closed (outdated)

In #3106531-103: Notify in Status Report that per-table database prefixes are no longer supported, and will throw errors in Drupal 10.0 and #3106531-109: Notify in Status Report that per-table database prefixes are no longer supported, and will throw errors in Drupal 10.0 the release manager @catch made the decision that there will be no trigger_error() for the deprecation of per-table prefixing. Therefore having a seperate issue for adding a hook_requirements() prior to 9.3 and adding a trigger_error() in another is no longer necessary. Therefore closing this issue.

mondrake’s picture

Status: Closed (outdated) » Active
mondrake’s picture

Status: Active » Needs review

daffie’s picture

Status: Needs review » Needs work

Testbot is not happy.

mondrake’s picture

Looks like we cannot do the hook_requirements check in isolation. UpdatePathTestBase does for instance write a $database entry in settings.php as part of its setup; that has a 'prefix' as an array, and test update fails on the new check. So one way or another we need to adjust also other code. But that's what #3106531: Notify in Status Report that per-table database prefixes are no longer supported, and will throw errors in Drupal 10.0 already does in a more complete way and I am not going to reinvent that here.

mondrake’s picture

Status: Needs work » Closed (outdated)