Problem/Motivation
Child issue of #2959269: [meta] Core should not trigger deprecated code except in tests and during updates
We currently ignore the "Drupal\system\Plugin\views\field\BulkForm is deprecated in Drupal 8.5.x, will be removed before Drupal 9.0.0. Use \Drupal\views\Plugin\views\field\BulkForm instead. See https://www.drupal.org/node/2916716." deprecation error.
Quit ignoring it, and fix deprecated usages.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 3006397-17.patch | 6.65 KB | lendude |
| #17 | interdiff-3006397-14-17.txt | 2.89 KB | lendude |
| #14 | 3006397-14.patch | 6.37 KB | lendude |
| #14 | interdiff-3006397-12-14.txt | 2.91 KB | lendude |
| #12 | 3006397-12.patch | 6.71 KB | lendude |
Comments
Comment #2
mile23A patch.
This is the only test that failed in the views group. Let's see what the rest of core has to say.
Comment #3
alexpottHmmm... as a plugin we should move the deprecation into the constructor because marking this test as a legacy doesn't fell right.
Comment #4
alexpottPlugin deprecations are a bit special see https://www.drupal.org/core/deprecation#how-plugin
Comment #5
mile23Nice catch on the deprecation method. The test is still legacy, however, because the deprecated plugin is still discovered and instantiated by the test.
Comment #6
mile23What's that you say? __construct() needs documentation? You are correct.
Comment #7
sean_e_dietrichPatch applied successfully. Fix also complies with Plugin Deprecation. Marking RTBC.
Comment #8
alexpottA legacy test means that it should be removed - I don’t think that is true in this case. I think we need to allow the test to ignore depreciations in a different way.
Comment #9
mile23The instantiation tests now expects the deprecation error, and we add another one that filters out plugins we know are deprecated.
Comment #11
berdirthe new docblock of the existing function (the way git diff sees it) was updated to mention it excludes deprecated but this is still the original that should now instead explicitly mention that it tests deprecated plugins or something.
Comment #12
lendudeNeeded a reroll so the interdiff looks a bit weird for DeprecationListenerTrait.
Updated the @legacy test to only test the deprecated plugins, before it was testing all the plugins which seems a little excessive. Updated the doc blocks to match that.
Comment #13
alexpottThis is looking good.
Let's combine the duplicated code into a protected method - that way if add to the generic plugin testing both deprecated and not deprecated plugins get the same tests without having to think too much.
Comment #14
lendudeHere we go, also removed a deprecated format_string.
Comment #15
berdirafaik part of the new format is also how the version is specified, drupal:8.5.0 and so on, but that isn't actually validated with the rule.
If we change that, the @deprecated docblock should be updated too. Still setting to RTBC, maybe that can be fixed on commit, or if that is indeed enough to hold up a commit, put back to needs work.
The test argument is a bit weird, but I agree it's nice to avoid the code duplication and possible differences.
Comment #17
lendudeNeeded a reroll and an update to the deprecated class to use the EntityTypeManagerInterface, also updated the version notation per #15
Comment #18
berdirShould be drupal:8.5.0 I think, not x
Comment #19
alexpottI considered whether
is fragile to being not updated. I've pondered about detecting whether something is deprecated by doing something like
But this would have problems the other way around - ie that you'd forget to add the
@expectedDeprecationto the test. So I think we're good to go here.Comment #20
alexpottCommitted 397cd30 and pushed to 8.8.x. Thanks!
Fixed on commit.