Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#5 | 3210900-5.patch | 3.05 KB | andypost |
#5 | interdiff.txt | 902 bytes | andypost |
#4 | 3210900-4.patch | 3.11 KB | andypost |
#4 | interdiff.txt | 519 bytes | andypost |
Comments
Comment #2
andypostComment #3
andypostFiled CR https://www.drupal.org/node/3210925 and follow-up #3210931: Remove deprecated update.inc functions
Comment #4
andypostFix CS
Comment #5
andypostAnd clean-up as include loaded via
setUp()
Comment #6
longwaveNice work! RTBC if bot agrees.
Comment #7
alexpottCommitted 2020570 and pushed to 9.2.x. Thanks!