Problem/Motivation
There are only two more functions I am aware of that must reside in .profile files, magic autoloading of .profile files can be the source of some very hard to find bugs.
There is a simple script to assist with converting the hooks in profiles and remaining functions can almost just be copy pasted.
We should deprecate the .profile file extension
Important to note: This is not about deprecating the Extension type of profile, just the procedural .profile files.
Steps to reproduce
N/A
Proposed resolution
Deprecate with a CR
Final fix is in #3623380: Create OOP replacement for hook_install_tasks and hook_install_tasks_alter
Remaining tasks
Check for .module extension files during hook collection.
Use the ExtensionFileIsConverted attribute core and contrib can use to skip deprecations.
Emit deprecations for any .module files without that attribute.
Identify documentation to update
Update general documentation
Add requirements check: #3587107: Add requirements check for deprecated .theme file extensions: Add requirements check for deprecated .profile file extensions
User interface changes
N/A
Introduced terminology
N/A
API changes
.profile files are deprecated
Data model changes
N/A
Release notes snippet
.profile file extensions have been deprecated, all code in .module files should be converted to classes. See https://www.drupal.org/node/3624829 for more guidance.
Comments
Comment #2
nicxvan commentedComment #3
nicxvan commentedComment #4
smustgrave commentedReading just the CR seems fine and even offers way to help convert. Question how come this wasn't attached to https://www.drupal.org/project/drupal/issues/3623380 ?
Comment #5
catch@smustgrave that issue just missed the beta deadline - we need to discuss whether to backport it to 12.0/11.5 during beta, but if we don't, we decided we could still publish an MR to warn profile owners now rather than in approximately 8 months, since most profiles don't implement hook_install_tasks() anyway. This is a bit outside how we usually do things, but seems worth the special case to give people lots of warning time.
I've published the CR, moving this to fixed.