Problem/Motivation
Remove all D12 deprecated code from the Migrate module.
Proposed resolution
Except the migrate module it should remove deprecated plugins from other modules, for example NodeUpdate7008
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3574717
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
Comment #2
quietone commentedThis should be limited to the deprecations in the Migrate module only.
Deprecated source, field, process and destination plugins are part of Migrate Drupal and are being removed in #3572280: Remove Migrate Drupal. The entries in
core/.deprecation-ignore.txtare also for Migrate Drupal, not the Migrate API.Comment #3
andypostComment #6
benjifisherComment #7
smustgrave commentedOpened #3577140: EntityContentBase make all parameters required for the one leftover. This should be ready for review.
Comment #8
benjifisherI am adding #3261004: Remove deprecated code from the migration system as a related issue. As we are discussing on the MR, the patch for that issue introduced an error that we now have to clean up.
Comment #9
benjifisherOn the MR and on Slack, I argued that we should re-deprecate letting
$account_switcherbeNULLand throw an exception (or an error) when$entity_type_bundle_infoisNULL. After thinking about it some more, I have changed my mind. I think we can now simply make both parameters ($account_switcherand$entity_type_bundle_info) required.For the record, this is what I worried about and why I think it is not actually a problem.
Suppose
EntityContentBase.parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles, $entity_field_manager, $field_type_manager)(and has not been updated in several years).validate: true.When the
$account_switcherparameter was added in Drupal 9.3.0, the code in (2) started triggering deprecation errors, but maybe the site owner did not notice them.In Drupal 10.0.0, the deprecation notices stopped because they were removed in #3261004. Because that issue did not make the parameter required, and because of (3), nothing bad happened.
In Drupal 11.2.0, we added new deprecation notices: not for
$account_switcherbut for$entity_type_bundle_info. I think that is good enough.Since the code has been generating deprecation notices since Drupal 11.2.0, I think it is OK to make both parameters required now that we are preparing for Drupal 12.
I am setting this issue to NW so that we can remove the deprecated code in
EntityContentBase. If we agree to that plan here, then I think we can close #3577140.Comment #10
andypostrebased and addressed #9
Comment #11
smustgrave commentedPersonally doesn’t matter to me but another reason we did the separate ticket for FormBuilder was for the git history
Comment #12
smustgrave commentedI don’t think I can make it though
Comment #13
benjifisher@smustgrave: I am not sure what you mean in Comments #11 and #12.
@andypost: Thanks for the updates.
I checked the change record https://www.drupal.org/node/3533565 and noticed that this issue does not remove the
import()method in the Comment module. It looks as though that was already done in #3574661: Remove deprecated code from comments module, so I am adding that as a related issue.I will continue my review later.
Comment #14
benjifisherFrom Comment #2:
That restriction never made it into the issue summary, but the current MR makes five exceptions:
import()methods, and these are being removed.EntityContentBaseand have their own constructors. These two classes are updated, making all constructor parameters required.I do not care about (1). I am just pointing out that it conflicts with Comment #2. I think it will not even cause merge conflicts, since Git is pretty good at recognizing when "the same" change is made in separate branches.
I think it makes sense to do (2) as part of this issue. In fact, PHPStan may insist that we do it as part of the same issue.
Also from Comment #2:
That file is not touched by the current MR, so I am removing it from the issue summary.
Comment #15
benjifisherI finished my review, and I left some comments on the MR. Back to NW.
Comment #16
andypostThank you! addressed feedback
Comment #17
benjifisher@andypost:
Thanks for the updates, and for adding
testMigrationDependenciesWithRemovedExpandArgument(). Everything looks great!Comment #18
catchOne comment on the MR.
Comment #19
smustgrave commentedTo keep the deprecation removals moving went ahead and removed the check. Since it was such a small change moved to RTBC.
Comment #20
catchThe test for it will also need to be removed.
Comment #21
smustgrave commentedOh yea removed
Comment #22
smustgrave commentedAll green
Comment #23
andypost+1 rtbc
Comment #24
benjifisherCan we go back in time and change the error message from
to
Or go back further in time and never add the parameter in the first place? (Mea culpa.)
I edited the change record mentioned in the deprecation message: https://www.drupal.org/node/3442785.
Comment #25
smustgrave commentedHaha you bring up a good point though. There’s a few things I’d like to change about deprecations and maybe one should be if we are saying it will throw an exception we should be 100% sure about that and mention what kind of exception. There were a few spots where it just exception (not here) but didn’t say which
Comment #27
catchCommitted/pushed to main, thanks!
@benjifisher we could do an 11.x change to the message if we want. We should maybe add that language as a template to the removal docs for future deprecations since it comes up often enough and that's a lot clearer.
Comment #30
benjifisher@catch:
I added #3582125: Improve the deprecation message in getMigrationDependencies(), now NR.
Can you give me a pointer to the removal docs?
Should I also update How to deprecate > Method parameters?
Comment #31
catch@benjifisher what you found is exactly what I was referring to as 'removal docs' even though I used the wrong word, something there would be great.
Comment #32
benjifisher@catch: done
Comment #33
benjifisherOn second thought: the @deprecated PHPdoc tag format and the
@trigger_error() formatare supposed to use the templateAm I going to mess up the API docs if I do not follow that format? If so, then I guess the deprecation message in #3582125: Improve the deprecation message in getMigrationDependencies() should be more like this:
Edit: Actually, there is no
@deprecatedtag in #3582125, but maybe I should update the change I just made in the "How to deprecate" doc.