Problem/Motivation

Drupal core still calls deprecated APIs. We have tools to identify them and help us reduce deprecated API use. Some use will be left due to the need to test deprecated code, and things we cannot remove before Drupal 9. This issue is to track progress and identify issues left to resolve.

Proposed resolution

Track progress using phpstan, categorize issues as appropriate.

Remaining tasks

-------------------------------
Errors in need of review: 15 (7 distinct)
Errors found in legacy tests: 416 (282 distinct)
Deprecated code called from deprecated code: 20 (10 distinct)
Known errors postponed on Drupal 9 branch opening: 65 (30 distinct)
Autoloading errors: 24 (24 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------

Errors in need of review:

4 | 3cdb8a | Instantiation of deprecated class Drupal\migrate\Plugin\migrate\process\Migration | #3004929: Fix 'The Drupal\migrate\Plugin\migrate\process\Migration is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use Drupal\migrate\Plugin\migrate\process\MigrationLookup' (currently blocked on #3004927: Create Migration Lookup and Stub services
1 | a901dc | Call to deprecated method getStyleSheetsRemove() of class Drupal\Core\Theme\ActiveTheme in core/lib/Drupal/Core/Asset/AssetResolver.php on line 167 | #3069052: Properly deprecate the stylesheets-remove key from theme info.yml files.
1 | 739c76 | Call to deprecated method handleHiddenType() of class Drupal\Core\Entity\EntityDisplayBase in core/lib/Drupal/Core/Entity/EntityDisplayBase.php on line 256 | #3082644: Properly deprecate type => 'hidden' component handling and EntityDisplayBase::handleHiddenType
1 | 302b29 | Call to deprecated method prepareComment() of class Drupal\comment\Plugin\migrate\source\d6\Comment in core/modules/comment/src/Plugin/migrate/source/d6/Comment.php on line 37 | #3069055: Undeprecate Drupal\comment\Plugin\migrate\source\d6\Comment::prepareComment()
-------------------------------

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A.

CommentFileSizeAuthor
#75 3038170-7.patch1.72 KBgábor hojtsy
#71 3038170-7.patch1.72 KBgábor hojtsy
#69 deprecations.txt55.03 KBgábor hojtsy
#69 coredeprecations.php_.txt8.62 KBgábor hojtsy
#66 coredeprecations.php_.txt8.61 KBmikelutz
#66 deprecations.txt55.03 KBmikelutz
#65 3038170-7.patch1.72 KBgábor hojtsy
#60 3038170-7.patch1.72 KBmikelutz
#58 3038170-7.patch1.72 KBmikelutz
#55 3038170-7.patch1.72 KBmikelutz
#51 3038170-7.patch1.72 KBgábor hojtsy
#48 coredeprecations.php_.txt8.55 KBmikelutz
#48 deprecations.txt54.82 KBmikelutz
#46 coredeprecations.php_.txt8.53 KBmikelutz
#46 deprecations.txt55.05 KBmikelutz
#40 coredeprecations.php_.txt8.48 KBmikelutz
#40 deprecations.txt55.53 KBmikelutz
#39 report-2019July19-2.txt54.3 KBgábor hojtsy
#38 3038170-7.patch1.72 KBgábor hojtsy
#36 coredeprecations_php.txt6 KBgábor hojtsy
#36 report-2019July19.txt54.45 KBgábor hojtsy
#34 report-2019July18.txt54.42 KBgábor hojtsy
#33 3038170-7.patch1.72 KBgábor hojtsy
#30 coredeprecations.php_.txt5.87 KBmikelutz
#30 deprecations.txt54.73 KBmikelutz
#29 coredeprecations_php.txt1.77 KBgábor hojtsy
#29 report-2019july12.txt52.6 KBgábor hojtsy
#28 coredeprecations_php.txt1.51 KBgábor hojtsy
#28 report-2019july12.txt40.09 KBgábor hojtsy
#21 report-2019july11.txt40.04 KBgábor hojtsy
#20 3038170-7.patch1.72 KBgábor hojtsy
#17 report-2019july1.txt39.3 KBgábor hojtsy
#16 3038170-7.patch1.72 KBgábor hojtsy
#15 3038170-15.drupal.8.6.x.patch1.97 KBmikelutz
#12 postgetmock.txt39.02 KBgábor hojtsy
#12 coredeprecations_php.txt1.46 KBgábor hojtsy
#11 3038170-7.patch1.72 KBgábor hojtsy
#10 3038170-7.patch1.72 KBgábor hojtsy
#8 3038170-7.patch1.72 KBgábor hojtsy
#7 3038170-7.patch1.72 KBgábor hojtsy
#4 3038170-4.patch1.72 KBMixologic
#2 3038170-1.patch496 bytesMixologic

Comments

Mixologic created an issue. See original summary.

Mixologic’s picture

Status: Active » Needs review
StatusFileSize
new496 bytes
jibran’s picture

While using phpstan locally memory is my biggest concern. Are only adding phpstan support or would we be using https://github.com/mglaman/phpstan-drupal?

Mixologic’s picture

StatusFileSize
new1.72 KB

This is a test issue where we've added support for phpstan provisionally to drupalci. Memory on the testbots is pretty gargantuan (60GB), so its also one of those things where its a good place to have it run.

We havent yet sorted out how and or what we want to display and to whom yet on drupal.org, but this will allow us to experiment with it so we can figure out what would be best.

Attached is a patch that is just phpstan and nothing else, to see if the jenkins parsing is working.

Status: Needs review » Needs work

The last submitted patch, 4: 3038170-4.patch, failed testing. View results

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

gábor hojtsy’s picture

Status: Needs work » Needs review
StatusFileSize
new1.72 KB

#3039472: Fix phpstan XML output is rolled out so this should work better. Same as #4.

gábor hojtsy’s picture

StatusFileSize
new1.72 KB
gábor hojtsy’s picture

StatusFileSize
new1.72 KB

Let's run again.

gábor hojtsy’s picture

StatusFileSize
new1.72 KB

Now with getMock() removed, it should be much less.

gábor hojtsy’s picture

Title: Phpstan deprecation testing » Drupal core's own deprecation testing results
Issue tags: +@deprecated, +Drupal 9
StatusFileSize
new1.46 KB
new39.02 KB

I devised this script to tell apart Legacy deprecations from the non-legacy ones. So far a legacy deprecation is one that is in a *Legacy*Test.php file or that contains WebTestBase in the error, assuming all of those left are actual legacy. Since we can only go based on the file name or error, it is not possible to do very creative matching, but I believe the goal is to identify top items.

I also attached the full results based on data from #11. These are the ones that at least occur 5 times:

688 | Call to deprecated function format_string()
86  | Call to deprecated method l() of class Drupal
38  | Call to deprecated method getUsername() of class Drupal\user\Entity\User
35  | Call to deprecated method setFieldNames() of class Drupal\Core\Entity\Sql\DefaultTableMapping
30  | Call to deprecated method url() of class Drupal\Core\Form\FormBase
29  | Call to deprecated function file_uri_scheme()
22  | Call to deprecated method install() of class Drupal\Core\Extension\ThemeHandler
19  | Call to deprecated method lookupDestinationId() of class Drupal\migrate\Plugin\MigrateIdMapInterface
16  | Call to deprecated method clearCachedDefinitions() of class Drupal\Core\Entity\EntityTypeRepository
13  | Call to deprecated method setExtraColumns() of class Drupal\Core\Entity\Sql\DefaultTableMapping
12  | Access to deprecated property $entityContextDefinition of class Drupal\Core\Plugin\Context\ContextDefinition.
12  | Call to deprecated method prepareLegacyRequest() of class Drupal\Core\DrupalKernel
11  | Call to deprecated function drupal_get_profile()
11  | Call to deprecated method drupalGetHeaders() of class Drupal\Tests\BrowserTestBase
9   | Call to deprecated method l() of class Drupal\Core\Controller\ControllerBase
9   | Call to deprecated method entityManager() of class Drupal
9   | Call to deprecated method install() of class Drupal\Core\Extension\ThemeHandlerInterface
8   | Call to deprecated function statistics_get()
8   | Call to deprecated method l() of class Drupal\Core\Form\FormBase
8   | Call to deprecated function file_stream_wrapper_valid_scheme()
7   | Call to deprecated method initializeEntityContextDefinition() of class Drupal\Core\Plugin\Context\ContextDefinition.
7   | Call to deprecated function drupal_render_root()
6   | Call to deprecated method url() of class Drupal\Core\Controller\ControllerBase
6   | Call to deprecated function system_list()
5   | Call to deprecated function _file_save_upload_from_form()
5   | Call to deprecated method isNewRevision() of class Drupal\node\Entity\NodeType
xjm’s picture

We noticed that some of the long tail in the above results are actually just autoloading errors. I stripped those manually with an emacs macro and put the data here:
https://docs.google.com/spreadsheets/d/1hAtFhN26UG0QpKxMqUi3-fyoMs54hYrV...

Somehow there are a few more things being counted than there were on Mar. 19 which should only have happened with either massively large new things deprecated in core (otherwise we would have removed the usages), or new deprecations in dependencies. I think. :)

xjm’s picture

I know how to check if it's the result of new dependency deprecations: queue the patch against 8.7.x. :P Might as well hit 8.6.x and earlier while we're at it to get some "historical"-ish data.

mikelutz’s picture

StatusFileSize
new1.97 KB

8.6.x compatible patch

gábor hojtsy’s picture

StatusFileSize
new1.72 KB

Uploading yet again for clear data - results mapping.

gábor hojtsy’s picture

StatusFileSize
new39.3 KB

Overall numbers are down like this:

May 31st:
Errors found outside legacy tests: 1405
Errors found in legacy tests: 179

July 1:
Errors found outside legacy tests: 1339
Errors found in legacy tests: 180

These are left with at least 5 occurrences outside of legacy tests:

687 | Call to deprecated function format_string()
86  | Call to deprecated method l() of class Drupal
35  | Call to deprecated method setFieldNames() of class Drupal\Core\Entity\Sql\DefaultTableMapping
30  | Call to deprecated method url() of class Drupal\Core\Form\FormBase
24  | Call to deprecated method install() of class Drupal\Core\Extension\ThemeHandler
19  | Call to deprecated method lookupDestinationId() of class Drupal\migrate\Plugin\MigrateIdMapInterface
16  | Call to deprecated method clearCachedDefinitions() of class Drupal\Core\Entity\EntityTypeRepository
13  | Call to deprecated method setExtraColumns() of class Drupal\Core\Entity\Sql\DefaultTableMapping
12  | Call to deprecated method prepareLegacyRequest() of class Drupal\Core\DrupalKernel
12  | Access to deprecated property $entityContextDefinition of class Drupal\Core\Plugin\Context\ContextDefinition.
11  | Call to deprecated function drupal_get_profile()
11  | Call to deprecated method drupalGetHeaders() of class Drupal\Tests\BrowserTestBase
9   | Call to deprecated method install() of class Drupal\Core\Extension\ThemeHandlerInterface
9   | Call to deprecated method l() of class Drupal\Core\Controller\ControllerBase
9   | Call to deprecated method entityManager() of class Drupal
8   | Call to deprecated function statistics_get()
8   | Call to deprecated method l() of class Drupal\Core\Form\FormBase
7   | Call to deprecated method initializeEntityContextDefinition() of class Drupal\Core\Plugin\Context\ContextDefinition.
7   | Call to deprecated function drupal_render_root()
6   | Call to deprecated method url() of class Drupal\Core\Controller\ControllerBase
6   | Call to deprecated function system_list()
5   | Call to deprecated function _file_save_upload_from_form()
5   | Call to deprecated method isNewRevision() of class Drupal\node\Entity\NodeType

Report generated with the script from #12.

gábor hojtsy’s picture

So now we can half the remaining deprecated APIs used by completing #2228741: Replace calls to format_string() with Drupal\Component\Render\FormattableMarkup. Reviews welcome there.

Mixologic’s picture

would it make sense to exclude the legacy tests from analysis by adding it to the phpstan.neon? Kinda like we exclude the migrate test fixtures...

gábor hojtsy’s picture

gábor hojtsy’s picture

StatusFileSize
new40.04 KB

Yay, we are significantly down, these are the ones left with 5 or more uses:

-------------------------------
Errors found outside legacy tests: 656
Errors found in legacy tests: 185
-------------------------------
Counts of errors outside legacy tests:

86  | Call to deprecated method l() of class Drupal
35  | Call to deprecated method setFieldNames() of class Drupal\Core\Entity\Sql\DefaultTableMapping
30  | Call to deprecated method url() of class Drupal\Core\Form\FormBase
24  | Call to deprecated method install() of class Drupal\Core\Extension\ThemeHandler
19  | Call to deprecated method lookupDestinationId() of class Drupal\migrate\Plugin\MigrateIdMapInterface
16  | Call to deprecated method clearCachedDefinitions() of class Drupal\Core\Entity\EntityTypeRepository
13  | Call to deprecated method setExtraColumns() of class Drupal\Core\Entity\Sql\DefaultTableMapping
12  | Call to deprecated method prepareLegacyRequest() of class Drupal\Core\DrupalKernel
12  | Access to deprecated property $entityContextDefinition of class Drupal\Core\Plugin\Context\ContextDefinition.
11  | Call to deprecated function drupal_get_profile()
11  | Call to deprecated method drupalGetHeaders() of class Drupal\Tests\BrowserTestBase
9   | Call to deprecated method l() of class Drupal\Core\Controller\ControllerBase
9   | Call to deprecated method install() of class Drupal\Core\Extension\ThemeHandlerInterface
9   | Call to deprecated method entityManager() of class Drupal
8   | Call to deprecated function statistics_get()
8   | Call to deprecated method l() of class Drupal\Core\Form\FormBase
7   | Call to deprecated function drupal_render_root()
7   | Call to deprecated method initializeEntityContextDefinition() of class Drupal\Core\Plugin\Context\ContextDefinition.
6   | Call to deprecated function system_list()
6   | Call to deprecated method url() of class Drupal\Core\Controller\ControllerBase
5   | Call to deprecated function _file_save_upload_from_form()
5   | Call to deprecated method isNewRevision() of class Drupal\node\Entity\NodeType
gábor hojtsy’s picture

New issues:

- #3067196: Properly deprecate LinkGeneratorTrait would cover the current top item thanks @alexpott.
- #3067206: Properly deprecate drupalGetHeaders() method of Drupal\Tests\BrowserTestBase covers 11 uses as well, thanks @voleger :)

voleger’s picture

voleger’s picture

mikelutz’s picture

My new plan is to start at the bottom and work my way up.. the bottom issues are much easier.. ;-)

#3067361: Properly deprecate NodeType::isNewRevision

mikelutz’s picture

I lied. There are more than 5 usages of NodeType::isNewRevision() they are just not type-hinted correctly.. :-(

gábor hojtsy’s picture

StatusFileSize
new40.09 KB
new1.51 KB

Looking at the 1 item results, there was some suspicious ones especially around single use file.inc functions. Turns out there is also *DeprecationTest.php files (4 of them) that invoke deprecated APIs on purpose. Filtering those out, running on the same data set from yesterday, it is down 5% from 656 to 623 :) There are still deprecated code invoked from deprecated code that we cannot detect this way, so only actually removing the APIs and seeing things possibly fail will uncover those. The 623 errors come from 262 types of things, but due to uses of traits, a lot of them are the same thing as well.

gábor hojtsy’s picture

StatusFileSize
new52.6 KB
new1.77 KB

Thanks to suggestion by @berdir, we should also ignore anything in 'modules/simpletest/*' and 'src/Tests/*', which further cuts down to 596 from 623 still using the same data set from yesterday.

mikelutz’s picture

StatusFileSize
new54.73 KB
new5.87 KB

Here is a new parsing script to combine some things, and to manually weed out the rest of the legacy test usage cases, and some other special cases that can be ignored right now.

-------------------------------
Errors in need of review: 346 (78 distinct)
Errors found in legacy tests: 322 (223 distinct)
Deprecated code called from Deprecated Code: 15 (8 distinct)
Known errors postponed on D9 branch opening: 13 (10 distinct)
Autoloading Errors: 28 (27 distinct)
Cache Tag Unclear errors: 4 (4 distinct)
-------------------------------
Errors in need of review:

86  | 4ae932 | Call to deprecated method l() of class Drupal | 
28  | 03770f | Call to deprecated method url() of class Drupal\Core\Form\FormBase | 
19  | c20a22 | Call to deprecated method lookupDestinationId() of class Drupal\migrate\Plugin\MigrateIdMapInterface | 
16  | e7ee56 | Call to deprecated method clearCachedDefinitions() of class Drupal\Core\Entity\EntityTypeRepository | 
12  | 737cec | Access to deprecated property $entityContextDefinition of class Drupal\Core\Plugin\Context\ContextDefinition. | 
12  | 46f674 | Call to deprecated method prepareLegacyRequest() of class Drupal\Core\DrupalKernel | 
11  | 186bb5 | Call to deprecated function drupal_get_profile() | 
9   | aeec37 | Call to deprecated method entityManager() of class Drupal | 
8   | 14a3cd | Call to deprecated function statistics_get() | 
8   | 957a6c | Usage of deprecated trait Drupal\Core\Field\AllowedTagsXssTrait | 
7   | 8120ab | Call to deprecated function drupal_render_root() | 
7   | 3524c4 | Call to deprecated method initializeEntityContextDefinition() of class Drupal\Core\Plugin\Context\ContextDefinition. | 
6   | 9cd736 | Call to deprecated function system_list() | 
6   | b8178f | Call to deprecated method url() of class Drupal\Core\Controller\ControllerBase | 
6   | dc2c3d | Class extends deprecated class Drupal\Core\Entity\EntityHandlerBase | 
5   | 565426 | Call to deprecated function _file_save_upload_from_form() | 
5   | e6b952 | Call to deprecated method isNewRevision() of class Drupal\node\Entity\NodeType | 
5   | 2216da | Usage of deprecated trait Drupal\Core\Routing\UrlGeneratorTrait | 
4   | 2d13e4 | Call to deprecated function deprecation_test_function() | 
4   | edcb4f | Instantiation of deprecated class Drupal\migrate\Plugin\migrate\process\DedupeEntity | 
4   | 3cdb8a | Instantiation of deprecated class Drupal\migrate\Plugin\migrate\process\Migration | 
3   | fce998 | Call to deprecated function config_get_config_directory() | 
3   | 262469 | Fetching class constant class of deprecated class Drupal\Component\Plugin\ConfigurablePluginInterface | 
2   | b5004b | Call to deprecated function language_negotiation_url_prefixes() | 
2   | e0a0b4 | Call to deprecated method addAutowiringType() of class Symfony\Component\DependencyInjection\Definition | 
2   | 3145a7 | Call to deprecated method cacheUntilConfigurationChanges() of class Drupal\Core\Access\AccessResult | 
2   | 4d6657 | Call to deprecated method getLabelCallback() of class Drupal\Core\Entity\EntityTypeInterface | 
2   | 3a0f6f | Call to deprecated method getSectionListFromId() of class Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage | 
2   | b65d10 | Call to deprecated method hashEquals() of class Drupal\Component\Utility\Crypt | 
2   | 789667 | Call to deprecated method isSafe() of class Drupal\Component\Utility\SafeMarkup | 
2   | c74175 | Call to deprecated method loadFromRoute() of class Drupal\layout_builder\SectionStorage\SectionStorageManager | 
2   | 22f199 | Call to deprecated method lookupDestinationId() of class Drupal\migrate\Plugin\migrate\id_map\Sql | 
2   | d936a8 | Call to deprecated method setRevisionAuthorId() of class Drupal\node\Entity\Node | 
2   | 9a9621 | Call to deprecated method setSectionList() of class Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase | 
2   | f9b6b7 | Call to deprecated method toArray() of class Drupal\Component\Version\Constraint | 
2   | 524ff7 | Call to deprecated method url() of class Drupal\Core\Entity\EntityBase | 
2   | 6ebd08 | Call to method isSafe() of deprecated class Drupal\Component\Utility\SafeMarkup | 
2   | 2a4b4f | Fetching class constant class of deprecated class Drupal\Core\Entity\EntityManagerInterface | 
2   | 19fb0b | Instantiation of deprecated class Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter | 
2   | 6dc55e | Usage of deprecated trait Drupal\Core\Routing\LinkGeneratorTrait | 
1   | 257d1f | Access to deprecated property $authenticationProviders of class Drupal\rest\Plugin\views\display\RestExport in core/modules/rest/src/Plugin/views/display/RestExport.php on line 150 | 
1   | 411a38 | Access to deprecated property $entityManager of class Drupal\Core\Entity\EntityForm in core/lib/Drupal/Core/Entity/ContentEntityForm.php on line 59 | 
1   | 620883 | Access to deprecated property $initialAccountId of class Drupal\Core\Session\AccountProxy in core/lib/Drupal/Core/Session/AccountProxy.php on line 175 | 
1   | d4ce31 | Call to deprecated function file_upload_max_size() in core/modules/file/file.module on line 964 | 
1   | 669467 | Call to deprecated function menu_primary_local_tasks() in core/includes/menu.inc on line 153 | 
1   | ba0feb | Call to deprecated function menu_secondary_local_tasks() in core/includes/menu.inc on line 154 | 
1   | 070480 | Call to deprecated method __construct() of class Drupal\file\FileUsage\FileUsageBase in core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php on line 40 | Bad deprecated tag in the constructor
1   | bee96a | Call to deprecated method doLoadRevisionFieldItems() of class Drupal\Core\Entity\ContentEntityStorageBase in core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php on line 620 | 
1   | b48306 | Call to deprecated method ensureBackwardCompatibilityConfiguration() of class Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase in core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginBase.php on line 66 | 
1   | da955c | Call to deprecated method fixTableNames() of class Drupal\views\Entity\View in core/modules/views/src/Entity/View.php on line 304 | 
1   | ab8b68 | Call to deprecated method getMaxAge() of class Drupal\Core\Datetime\FormattedDateDiff in core/tests/Drupal/Tests/Core/Datetime/DateTest.php on line 425 | 
1   | 07b854 | Call to deprecated method getParents() of class Drupal\forum\ForumManagerInterface in core/modules/forum/src/Controller/ForumController.php on line 157 | 
1   | 982184 | Call to deprecated method getSource() of class Drupal\twig_loader_test\Loader\TestLoader in core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php on line 17 | 
1   | 432cb5 | Call to deprecated method getStatus() of class Drupal\comment\CommentInterface in core/modules/comment/src/CommentForm.php on line 143 | 
1   | 50482e | Call to deprecated method getStatus() of class Drupal\comment\Entity\Comment in core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php on line 74 | 
1   | a901dc | Call to deprecated method getStyleSheetsRemove() of class Drupal\Core\Theme\ActiveTheme in core/lib/Drupal/Core/Asset/AssetResolver.php on line 167 | 
1   | 739c76 | Call to deprecated method handleHiddenType() of class Drupal\Core\Entity\EntityDisplayBase in core/lib/Drupal/Core/Entity/EntityDisplayBase.php on line 256 | 
1   | a8e7e2 | Call to deprecated method hasLabelCallback() of class Drupal\Core\Entity\EntityTypeInterface in core/modules/jsonapi/src/JsonApiResource/ResourceObject.php on line 287 | 
1   | c2dfa1 | Call to deprecated method isNewRevision() of class Drupal\node\NodeTypeInterface in core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php on line 57 | 
1   | 302b29 | Call to deprecated method prepareComment() of class Drupal\comment\Plugin\migrate\source\d6\Comment in core/modules/comment/src/Plugin/migrate/source/d6/Comment.php on line 37 | 
1   | 454fc6 | Call to deprecated method resolveBackwardCompatibilityConfiguration() of class Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase in core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginBase.php on line 57 | 
1   | 38ed4c | Call to deprecated method setDefault() of class Drupal\Core\Extension\ThemeHandler in core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php on line 104 | 
1   | ddd776 | Call to deprecated method url() of class Drupal\views\Plugin\views\display\PathPluginBase in core/modules/views/src/Plugin/views/display/PathPluginBase.php on line 445 | 
1   | 1845cc | Call to deprecated method url() of class Drupal\views\Plugin\views\wizard\WizardPluginBase in core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php on line 218 | 
1   | b98414 | Call to deprecated method validateTags() of class Drupal\Core\Cache\Cache. in core/tests/Drupal/Tests/Core/Cache/CacheTest.php on line 54 | 
1   | b33594 | Class extends deprecated class PHPUnit\Framework\BaseTestListener in core/tests/Drupal/Tests/Listeners/DrupalListener.php on line 21 | 
1   | 2ce122 | Class implements deprecated interface Drupal\Core\Field\PluginSettingsInterface in core/lib/Drupal/Core/Field/PluginSettingsBase.php on line 13 | 
1   | 58f958 | Class implements deprecated interface Twig\Loader\ExistsLoaderInterface in core/lib/Drupal/Core/Template/Loader/StringLoader.php on line 27 | 
1   | f1103a | Class implements deprecated interface Twig\Loader\SourceContextLoaderInterface in core/lib/Drupal/Core/Template/Loader/StringLoader.php on line 27 | 
1   | ced8c1 | Class implements deprecated interface Twig_ExistsLoaderInterface in core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php on line 10 | 
1   | 39cd42 | Class implements deprecated interface Twig_SourceContextLoaderInterface in core/modules/system/tests/modules/twig_loader_test/src/Loader/TestLoader.php on line 10 | 
1   | 495dea | Fetching class constant class of deprecated class Drupal\Core\Entity\EntityHandlerBase in core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php on line 400 | 
1   | 848d3b | Fetching class constant class of deprecated class Symfony\Component\ClassLoader\ApcClassLoader in core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php on line 96 | 
1   | ea0fab | Instantiation of deprecated class Symfony\Component\ClassLoader\ApcClassLoader in core/lib/Drupal/Core/DrupalKernel.php on line 1088 | 
1   | 29a10c | Instantiation of deprecated class Symfony\Component\ClassLoader\WinCacheClassLoader in core/lib/Drupal/Core/DrupalKernel.php on line 1091 | 
1   | 3b0c85 | Instantiation of deprecated class Symfony\Component\ClassLoader\XcacheClassLoader in core/lib/Drupal/Core/DrupalKernel.php on line 1094 | 
1   | 150baa | Interface Drupal\Core\Field\FormatterInterface extends deprecated interface Drupal\Core\Field\PluginSettingsInterface in core/lib/Drupal/Core/Field/FormatterInterface.php on line 12 | 
1   | 40aa9b | Interface Drupal\Core\Field\WidgetBaseInterface extends deprecated interface Drupal\Core\Field\PluginSettingsInterface in core/lib/Drupal/Core/Field/WidgetBaseInterface.php on line 16 | 

mikelutz’s picture

I only manually cleared out the legacy test usages from the items that only had 1 usage. some of the remaining ones with 2 or 3 usages might be okay too, but my brain is done for today. :-)

alexpott’s picture

@mikelutz nice work. Yeah we somehow need to be able to identify things like system_list() which are properly deprecated.

gábor hojtsy’s picture

StatusFileSize
new1.72 KB

A bunch of issues landed, so let's try again. :)

gábor hojtsy’s picture

StatusFileSize
new54.42 KB

The parsed output of that is the following (5 or more usages). Definitely trending down! Full report attached.

-------------------------------
Errors in need of review: 320 (74 distinct)
Errors found in legacy tests: 323 (224 distinct)
Deprecated code called from Deprecated Code: 15 (8 distinct)
Known errors postponed on D9 branch opening: 13 (10 distinct)
Autoloading Errors: 28 (27 distinct)
Cache Tag Unclear errors: 4 (4 distinct)
-------------------------------
Errors in need of review:

86  | 4ae932 | Call to deprecated method l() of class Drupal | 
28  | 03770f | Call to deprecated method url() of class Drupal\Core\Form\FormBase | 
16  | e7ee56 | Call to deprecated method clearCachedDefinitions() of class Drupal\Core\Entity\EntityTypeRepository | 
12  | 737cec | Access to deprecated property $entityContextDefinition of class Drupal\Core\Plugin\Context\ContextDefinition. | 
12  | 46f674 | Call to deprecated method prepareLegacyRequest() of class Drupal\Core\DrupalKernel | 
11  | 186bb5 | Call to deprecated function drupal_get_profile() | 
9   | aeec37 | Call to deprecated method entityManager() of class Drupal | 
8   | 14a3cd | Call to deprecated function statistics_get() | 
8   | 957a6c | Usage of deprecated trait Drupal\Core\Field\AllowedTagsXssTrait | 
7   | 8120ab | Call to deprecated function drupal_render_root() | 
7   | 3524c4 | Call to deprecated method initializeEntityContextDefinition() of class Drupal\Core\Plugin\Context\ContextDefinition. | 
6   | 9cd736 | Call to deprecated function system_list() | 
6   | b8178f | Call to deprecated method url() of class Drupal\Core\Controller\ControllerBase | 
5   | 565426 | Call to deprecated function _file_save_upload_from_form() | 
5   | e6b952 | Call to deprecated method isNewRevision() of class Drupal\node\Entity\NodeType | 
5   | 2216da | Usage of deprecated trait Drupal\Core\Routing\UrlGeneratorTrait | 
alexpott’s picture

Here's some nice context to a few of the things in the list in #34

  • 12 | 737cec | Access to deprecated property $entityContextDefinition of class Drupal\Core\Plugin\Context\ContextDefinition. | This is part of a BC layer that's all marked private and will be removed in Drupal 9 but can not in 8
  • 9 | aeec37 | Call to deprecated method entityManager() of class Drupal | is deprecated properly and only called from test code. Mind you we should deprecate \Drupal\views\FieldAPIHandlerTrait::getEntityManager() and \Drupal\image\Plugin\Field\FieldType\ImageItem::getEntityManager()
  • 7 | 3524c4 | Call to deprecated method initializeEntityContextDefinition() of class Drupal\Core\Plugin\Context\ContextDefinition. | This is part of a BC layer that's all marked private and will be removed in Drupal 9 but can not in 8
  • 6 | 9cd736 | Call to deprecated function system_list() | is only called from legacy testing

So we're in an even better place.

gábor hojtsy’s picture

StatusFileSize
new54.45 KB
new6 KB

Thanks @alexpott. Updated the summary script with:

    '737cec' => 'pp',
    'aeec37' => 'legacy',
    '3524c4' => 'pp',
    '9cd736' => 'legacy',
    '2d13e4' => 'legacy',

Note that the new 2d13e4 I (easily) identified as a false positive. It is Call to deprecated function deprecation_test_function() :D only used in test code testing deprecations.

Results are significantly down with these (ones with 5 or more to review):

-------------------------------
Errors in need of review: 282 (69 distinct)
Errors found in legacy tests: 342 (227 distinct)
Deprecated code called from deprecated code: 15 (8 distinct)
Known errors postponed on Drupal 9 branch opening: 32 (12 distinct)
Autoloading errors: 28 (27 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------
Errors in need of review:

86  | 4ae932 | Call to deprecated method l() of class Drupal | 
28  | 03770f | Call to deprecated method url() of class Drupal\Core\Form\FormBase | 
16  | e7ee56 | Call to deprecated method clearCachedDefinitions() of class Drupal\Core\Entity\EntityTypeRepository | 
12  | 46f674 | Call to deprecated method prepareLegacyRequest() of class Drupal\Core\DrupalKernel | 
11  | 186bb5 | Call to deprecated function drupal_get_profile() | 
8   | 14a3cd | Call to deprecated function statistics_get() | 
8   | 957a6c | Usage of deprecated trait Drupal\Core\Field\AllowedTagsXssTrait | 
7   | 8120ab | Call to deprecated function drupal_render_root() | 
6   | b8178f | Call to deprecated method url() of class Drupal\Core\Controller\ControllerBase | 
5   | 565426 | Call to deprecated function _file_save_upload_from_form() | 
5   | e6b952 | Call to deprecated method isNewRevision() of class Drupal\node\Entity\NodeType | 
5   | 2216da | Usage of deprecated trait Drupal\Core\Routing\UrlGeneratorTrait | 
gábor hojtsy’s picture

Issue summary: View changes
gábor hojtsy’s picture

StatusFileSize
new1.72 KB

Let's update based on recent commits.

gábor hojtsy’s picture

StatusFileSize
new54.3 KB

Down 28 more :) Ones with 5 or more:

-------------------------------
Errors in need of review: 254 (66 distinct)
Errors found in legacy tests: 343 (228 distinct)
Deprecated code called from deprecated code: 15 (8 distinct)
Known errors postponed on Drupal 9 branch opening: 32 (12 distinct)
Autoloading errors: 28 (27 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------
Errors in need of review:

86  | 4ae932 | Call to deprecated method l() of class Drupal | 
28  | 03770f | Call to deprecated method url() of class Drupal\Core\Form\FormBase | 
12  | 46f674 | Call to deprecated method prepareLegacyRequest() of class Drupal\Core\DrupalKernel | 
11  | 186bb5 | Call to deprecated function drupal_get_profile() | 
8   | 14a3cd | Call to deprecated function statistics_get() | 
8   | 957a6c | Usage of deprecated trait Drupal\Core\Field\AllowedTagsXssTrait | 
6   | b8178f | Call to deprecated method url() of class Drupal\Core\Controller\ControllerBase | 
5   | 565426 | Call to deprecated function _file_save_upload_from_form() | 
5   | 2216da | Usage of deprecated trait Drupal\Core\Routing\UrlGeneratorTrait | 
mikelutz’s picture

StatusFileSize
new55.53 KB
new8.48 KB

I went through the list and moved more into postponed/legacy/dcdc. I also added/linked issues for all the outstanding ones. Sorry for the dump here, but I think it's useful

Edit: moved dump to the IS for others to edit.

berdir’s picture

> 2 | 524ff7 | Call to deprecated method url() of class Drupal\Core\Entity\EntityBase | #3067198: Properly deprecate UrlGeneratorTrait

Entity::url() is not about UrlGeneratorTrait and is already fully deprecated, those most be tests/deprecated code => this is done.

> 1 | 411a38 | Access to deprecated property $entityManager of class Drupal\Core\Entity\EntityForm in core/lib/Drupal/Core/Entity/ContentEntityForm.php on line 59 | #2450793: Properly deprecate support for entity type label callbacks

Wrong issue, should be the same as the one above?

Maybe move this list into the issue summary so every can update it? Great work btw.

mikelutz’s picture

Issue summary: View changes

I copied it as is, I'm on my phone. Have at it. :-)

voleger’s picture

#2958925: Properly deprecate drupal_get_profile() is in
few child issues needs review

mikelutz’s picture

Status: Needs review » Reviewed & tested by the community

edit: oops, posted on wrong issue.

mikelutz’s picture

Status: Reviewed & tested by the community » Needs work
mikelutz’s picture

Issue summary: View changes
StatusFileSize
new55.05 KB
new8.53 KB

Latest results, fixing a couple incorrect links in the script + updating IS.

-------------------------------
Errors in need of review: 144 (30 distinct)
Errors found in legacy tests: 359 (239 distinct)
Deprecated code called from deprecated code: 20 (10 distinct)
Known errors postponed on Drupal 9 branch opening: 65 (30 distinct)
Autoloading errors: 28 (27 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------
mikelutz’s picture

mikelutz’s picture

Issue summary: View changes
StatusFileSize
new54.82 KB
new8.55 KB
-------------------------------
Errors in need of review: 140 (26 distinct)
Errors found in legacy tests: 363 (242 distinct)
Deprecated code called from deprecated code: 20 (10 distinct)
Known errors postponed on Drupal 9 branch opening: 65 (30 distinct)
Autoloading errors: 28 (27 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------
mikelutz’s picture

Issue summary: View changes
mikelutz’s picture

gábor hojtsy’s picture

Status: Needs work » Needs review
StatusFileSize
new1.72 KB

Drupal::l() landed :)

mikelutz’s picture

Issue summary: View changes
-------------------------------
Errors in need of review: 44 (23 distinct)
Errors found in legacy tests: 368 (247 distinct)
Deprecated code called from deprecated code: 20 (10 distinct)
Known errors postponed on Drupal 9 branch opening: 65 (30 distinct)
Autoloading errors: 28 (27 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------
mikelutz’s picture

Issue summary: View changes
mikelutz’s picture

mikelutz’s picture

StatusFileSize
new1.72 KB
mikelutz’s picture

Issue summary: View changes
-------------------------------
Errors in need of review: 40 (20 distinct)
Errors found in legacy tests: 371 (250 distinct)
Deprecated code called from deprecated code: 20 (10 distinct)
Known errors postponed on Drupal 9 branch opening: 65 (30 distinct)
Autoloading errors: 28 (27 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------
mikelutz’s picture

mikelutz’s picture

StatusFileSize
new1.72 KB
mikelutz’s picture

Issue summary: View changes
-------------------------------
Errors in need of review: 33 (14 distinct)
Errors found in legacy tests: 380 (257 distinct)
Deprecated code called from deprecated code: 20 (10 distinct)
Known errors postponed on Drupal 9 branch opening: 65 (30 distinct)
Autoloading errors: 28 (27 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------
mikelutz’s picture

StatusFileSize
new1.72 KB
gábor hojtsy’s picture

gábor hojtsy’s picture

Issue summary: View changes

Hm, we actually went up a bit:

-------------------------------
Errors in need of review: 40 (19 distinct)
Errors found in legacy tests: 373 (252 distinct)
Deprecated code called from deprecated code: 20 (10 distinct)
Known errors postponed on Drupal 9 branch opening: 65 (30 distinct)
Autoloading errors: 28 (27 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------

Somehow #2450793: Properly deprecate support for entity type label callbacks is back in 4 instances.

mikelutz’s picture

I may not have posted my latest script. Every time we fix one we add a legacy test that then needs to be marked in the script, or it still shows up. You just re-added several closed issues that I had been taking out.

xjm’s picture

Issue tags: +mwds2019
gábor hojtsy’s picture

StatusFileSize
new1.72 KB

Two more issues landed. Retesting. Will wait for @mikelutz's updated script to summarise.

mikelutz’s picture

Issue summary: View changes
StatusFileSize
new55.03 KB
new8.61 KB
-------------------------------
Errors in need of review: 18 (10 distinct)
Errors found in legacy tests: 382 (259 distinct)
Deprecated code called from deprecated code: 20 (10 distinct)
Known errors postponed on Drupal 9 branch opening: 65 (30 distinct)
Autoloading errors: 28 (27 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------
gábor hojtsy’s picture

Looks like it should be 9 unique as this one is found but already fixed(?)

1 | 46f674 | Call to deprecated method prepareLegacyRequest() of class Drupal\Core\DrupalKernel in core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php on line 209 | #2869573: Remove usages of deprecated DrupalKernel::prepareLegacyRequest()

mikelutz’s picture

Yeah, looks like I missed one.

gábor hojtsy’s picture

Issue summary: View changes
StatusFileSize
new8.62 KB
new55.03 KB

Updated :)

-------------------------------
Errors in need of review: 17 (9 distinct)
Errors found in legacy tests: 383 (260 distinct)
Deprecated code called from deprecated code: 20 (10 distinct)
Known errors postponed on Drupal 9 branch opening: 65 (30 distinct)
Autoloading errors: 28 (27 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------
mikelutz’s picture

gábor hojtsy’s picture

StatusFileSize
new1.72 KB

Let's run this again :)

mikelutz’s picture

Issue summary: View changes
-------------------------------
Errors in need of review: 15 (7 distinct)
Errors found in legacy tests: 416 (282 distinct)
Deprecated code called from deprecated code: 20 (10 distinct)
Known errors postponed on Drupal 9 branch opening: 65 (30 distinct)
Autoloading errors: 24 (24 distinct)
Cache tag unclear errors: 4 (4 distinct)
-------------------------------
mikelutz’s picture

Issue summary: View changes
mikelutz’s picture

Issue summary: View changes
gábor hojtsy’s picture

StatusFileSize
new1.72 KB

Three more patches landed from above.

voleger’s picture

Issue summary: View changes

Update errors list from IS

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs review » Reviewed & tested by the community

Stumbled on this issue.

All the child issues are closed and phpstan is now running on Core, #3178534: Start running PHPStan on Drupal core (level 0). I don't see anything else to do here. Setting to RTBC just in case I missed something at this late hour.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Agreed, I think we can close this. If we enable new phpstan levels we can have new issues to fix anything that comes up too.

Status: Fixed » Closed (fixed)

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