Problem/Motivation

Steps to reproduce

Use grep to find @deprecated in system module, excluding drupal:13

$ grep -rn "@deprecated" -A1 core/modules/system/ | grep -E "(@deprecated.*|drupal:)" | grep -v "drupal:13"

Truncated output:

core/modules/system/system.module:70
core/modules/system/system.module:390
core/modules/system/system.module:412
core/modules/system/system.module:431
core/modules/system/system.module:461
core/modules/system/system.module:490
core/modules/system/system.module:511
core/modules/system/system.module:529
core/modules/system/templates/authorize-report.html.twig:16
core/modules/system/src/SystemManager.php:59
core/modules/system/src/SystemManager.php:69
core/modules/system/src/SystemManager.php:79
core/modules/system/src/SystemManager.php:157
core/modules/system/src/Plugin/migrate/process/d6/SystemUpdate7000.php:13
core/modules/system/src/Plugin/migrate/destination/d7/ThemeSettings.php:16
core/modules/system/system.install:36
core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php:622
core/modules/system/tests/modules/deprecation_test/deprecation_test.module:16
core/modules/system/tests/modules/entity_test/entity_test.module:24
core/modules/system/tests/modules/entity_test/entity_test.module:43

Also look for E_USER_DEPRECATED:

$ grep -rnE "drupal:12.*E_USER_DEPRECATED" core/modules/system

Truncated output:

core/modules/system/src/Plugin/Block/SystemBrandingBlock.php:38
core/modules/system/src/Hook/SystemHooks.php:509
core/modules/system/src/Form/ThemeSettingsForm.php:354
core/modules/system/system.admin.inc:7

Proposed resolution

Remove them all, except:

Also remove or update migrations that use deprecated sources or destinations from system module, and tests related to these migrations:

  • d6_user_role migration
  • d7_theme_settings migration
  • d7_theme_settings migrate source plugin (although only the destination was deprecated)

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3573896

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

mstrelan created an issue. See original summary.

mstrelan’s picture

Status: Active » Needs work

Have done system.module, feel free to continue with the rest.

mstrelan’s picture

mstrelan’s picture

Issue summary: View changes
Status: Needs work » Needs review

Found a few more grepping for E_USER_DEPRECATED. Added these to the IS and updated the MR.

mstrelan’s picture

Issue summary: View changes
mstrelan’s picture

Status: Needs review » Needs work

Lots of fails related to migrate_drupal. Might be worth postponing on #3522602: [meta] Tasks to remove Migrate Drupal module. Leaving NW in case there is a simple fix to get this through.

mstrelan’s picture

Issue summary: View changes
Status: Needs work » Needs review

OK those were easy enough to fix by removing more things. I'm a bit unsure about the d7_theme_settings migrate source plugin. The destination was deprecated, but the source was not. Maybe we need to keep that. But if we do, then do we need to refactor the test to use a different destination?

mstrelan’s picture

This has been a thrilling conversation, thanks for sticking with me. The migrate source plugin is indeed deprecated, but only via the DrupalSqlBase base class. So should be fine to delete.

dcam’s picture

Status: Needs review » Needs work

I didn't find anything to comment on in the MR, but I found other related things in the code base to consider. I'm setting the status to Needs Work because I'm pretty sure at least some of this is in-scope.

There's a reference to template_preprocess_entity_add_list() in the docblock example of hook_theme_registry_alter(). See https://git.drupalcode.org/project/drupal/-/blob/main/core/lib/Drupal/Co.... Should this be updated to reference the theme hook class method?

I saw that we're removing authorize-report.html.twig. Should template_preprocess_authorize_report() and the stable9 template be removed at this time too? See https://git.drupalcode.org/project/drupal/-/blob/main/core/includes/them... and https://git.drupalcode.org/project/drupal/-/blob/main/core/themes/stable....

I checked out theme_settings_convert_to_config() since it's used by the D7 migrate destination plugin. It's still used by ThemeSettingsForm, so the function is still valid. But its docblock mentions that the settings may come from a D7 website, which won't be true anymore. Editing this to remove the mention of D7 is probably in-scope. See https://git.drupalcode.org/project/drupal/-/blob/main/core/includes/them....

And one final note: #3096972: The Drupal 7 ThemeSettings source plugin does not check that the destination site has a valid theme to migrate settings into was postponed on the removal of migrate_drupal, but it can probably be closed when this MR is committed.

dcam’s picture

Additional deprecations that probably weren't caught by your regex:

The system.file path config schema is deprecated for removal in D12. See https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste....

Moved files in the status.report library. See https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste....

The system.module_admin_links_memory_cache service. See https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste....

StatusReportPage converts legacy severity constants to an Enum via RequirementSeverity::convertLegacyIntSeveritiesToEnums(). This behavior is deprecated for removal in D12. This was found via the test for behavior in StatusReportPageTest, which will also need to be removed. See https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste... and https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste....

There's another legacy test at https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste.... But the deprecation is caused by Drupal\Core\Session\SessionManager, so removing this could be considered to not be in-scope. If it is, then the utilized code in the session_test module may need to be removed too.

There are tests related to the deprecation of .engine files at https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste... and https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste.... But again that deprecation is coming from outside the system module, Drupal\Core\Theme\ThemeInitialization, so the removals may not be in-scope.

mstrelan’s picture

Thanks for the thorough review

There's a reference to template_preprocess_entity_add_list() in the docblock example of hook_theme_registry_alter(). See https://git.drupalcode.org/project/drupal/-/blob/main/core/lib/Drupal/Co.... Should this be updated to reference the theme hook class method?

Possibly a few other updates here as well. I've updated to match what I see when I put a breakpoint in \Drupal\system\Hook\SystemHooks::themeRegistryAlter after installing the minimal profile with claro enabled.

Will come back to the rest later.

mstrelan’s picture

Status: Needs work » Needs review

I've address most of this now, some replies below.

I saw that we're removing authorize-report.html.twig. Should template_preprocess_authorize_report() and the stable9 template be removed at this time too? See https://git.drupalcode.org/project/drupal/-/blob/main/core/includes/them... and https://git.drupalcode.org/project/drupal/-/blob/main/core/themes/stable....

I think yes for template_preprocess_authorize_report but not sure for stable9, that will happen anyway in #3560200: [meta] Tasks to deprecate Stable 9.

StatusReportPage converts legacy severity constants to an Enum via RequirementSeverity::convertLegacyIntSeveritiesToEnums(). This behavior is deprecated for removal in D12. This was found via the test for behavior in StatusReportPageTest, which will also need to be removed. See https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste... and https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste....

Let's leave this for now until the consts in install.inc get removed. The test should fail at that time and this will get picked up. The scope of this issue is to remove things that the system module is deprecating, rather than use of other deprecated code. I think.

There's another legacy test at https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste.... But the deprecation is caused by Drupal\Core\Session\SessionManager, so removing this could be considered to not be in-scope. If it is, then the utilized code in the session_test module may need to be removed too.

There are tests related to the deprecation of .engine files at https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste... and https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/syste.... But again that deprecation is coming from outside the system module, Drupal\Core\Theme\ThemeInitialization, so the removals may not be in-scope.

As per previous comment.

dcam’s picture

Status: Needs review » Reviewed & tested by the community

The new changes look good to me. My feedback was addressed. It's fine and appropriate to not remove the deprecated things that are not in the system module.

catch’s picture

Status: Reviewed & tested by the community » Needs work

The migrate removals here are going to conflict with migrate_drupal and migrate_drupal_ui removal which is it's own considerable task. I think it would be easier to remove them from here and let them be handled in those issues. Otherwise this looks good!

mstrelan’s picture

Status: Needs work » Postponed

Should we postpone this on #3572280: Remove Migrate Drupal then?

catch’s picture

I think we could probably just remove those changes from the MR and commit the rest? (but did not look closely enough to see if that would make things complicated).

mstrelan’s picture

Status: Postponed » Needs work

Either way, that's in now so back to NW

sujal kshatri made their first commit to this issue’s fork.

mstrelan’s picture

Thanks for rebasing this. I haven't cross-checked that everything has been removed, but I did find one issue with the rebase. The system_schema function was removed in #3335756: Drop sequences table in Drupal 12 and we are inadvertently restoring it here. Will need to fix that up at least.

sujal kshatri’s picture

Hey I removed that section which was not supposed to be added in the MR , Some mistake might have happened during the rebase

sujal kshatri’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Reviewed & tested by the community

Added a suggestion about the hook_theme() example (adding it to the claro OOP issue to reduce conflicts) but RTBC either way.

  • catch committed dce563e4 on main
    task: #3573896 Remove deprecations from System module
    
    By: mstrelan
    By:...
dcam’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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