Problem/Motivation

Spotted while reviewing #2124069: Convert schema.inc to the update.update_hook_registry service (UpdateHookRegistry)

update_set_schema() is not used in core except in a test:

core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php
82:    // Test the update_set_schema() utility function.
84:    update_set_schema('update_test_schema', 8003);

core/includes/update.inc
157:function update_set_schema($module, $schema_version) {

It was introduced for a single use case when we had a Drupal 7 to 8 upgrade path prior to requiring migrations: #2001310: Disallow firing hooks during update

The function comment notes that "This function is rarely necessary."

It is unused in contrib: http://grep.xnddx.ru/search?text=update_set_schema&filename=

Steps to reproduce

Proposed resolution

Deprecate it for removal in Drupal 10 with no replacement.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave created an issue. See original summary.

andypost’s picture

Issue tags: +@deprecated, +Kill includes
andypost’s picture

andypost’s picture

FileSize
519 bytes
3.11 KB

Fix CS

andypost’s picture

And clean-up as include loaded via setUp()

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Nice work! RTBC if bot agrees.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2020570 and pushed to 9.2.x. Thanks!

  • alexpott committed 2020570 on 9.2.x
    Issue #3210900 by andypost, longwave: Deprecate update_set_schema() for...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.