Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
CUSTOM PROJECTS
--------------------------------------------------------------------------------
Examples for Developers
Scanned on Tue, 05/26/2020 - 19:04.
5 errors found. Avoid some manual work by using drupal-rector for fixing issues
automatically or Upgrade Rector to generate patches.
modules/contrib/examples/file_example/src/Form/FileExampleReadWriteForm.php:
┌──────────┬──────┬─────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├──────────┼──────┼─────────────────────────────────────────────────────────────┤
│ Fix now │ 392 │ Call to deprecated constant FILE_EXISTS_RENAME: Deprecated │
│ │ │ in drupal:8.7.0 and is removed from drupal:9.0.0. Use │
│ │ │ Drupal\Core\File\FileSystemInterface::EXISTS_RENAME. │
│ │ │ │
│ Fix with │ 452 │ Call to deprecated constant FILE_EXISTS_REPLACE: Deprecated │
│ rector │ │ in drupal:8.7.0 and is removed from drupal:9.0.0. Use │
│ │ │ Drupal\Core\File\FileSystemInterface::EXISTS_REPLACE. │
│ │ │ │
└──────────┴──────┴─────────────────────────────────────────────────────────────┘
modules/contrib/examples/testing_example/src/Tests/NaiveConversionTest.php:
┌─────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├─────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix now │ 17 │ Class Drupal\testing_example\Tests\NaiveConversionTest │
│ │ │ extends deprecated class Drupal\simpletest\WebTestBase. │
│ │ │ Deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. │
│ │ │ Instead, use Drupal\Tests\BrowserTestBase. See │
│ │ │ https://www.drupal.org/node/3030340. Replacement available │
│ │ │ from drupal:8.6.0. │
│ │ │ │
└─────────┴──────┴──────────────────────────────────────────────────────────────┘
modules/contrib/examples/testing_example/src/Tests/SimpleTestExampleMockModuleTe
st.php:
┌─────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├─────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix now │ 32 │ Class │
│ │ │ Drupal\testing_example\Tests\SimpleTestExampleMockModuleTest │
│ │ │ extends deprecated class Drupal\simpletest\WebTestBase. │
│ │ │ Deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. │
│ │ │ Instead, use Drupal\Tests\BrowserTestBase. See │
│ │ │ https://www.drupal.org/node/3030340. Replacement available │
│ │ │ from drupal:8.6.0. │
│ │ │ │
└─────────┴──────┴──────────────────────────────────────────────────────────────┘
modules/contrib/examples/testing_example/src/Tests/SimpleTestExampleTest.php:
┌─────────┬──────┬──────────────────────────────────────────────────────────────┐
│ STATUS │ LINE │ MESSAGE │
├─────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Fix now │ 31 │ Class Drupal\testing_example\Tests\SimpleTestExampleTest │
│ │ │ extends deprecated class Drupal\simpletest\WebTestBase. │
│ │ │ Deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. │
│ │ │ Instead, use Drupal\Tests\BrowserTestBase. See │
│ │ │ https://www.drupal.org/node/3030340. Replacement available │
│ │ │ from drupal:8.6.0. │
│ │ │ │
└─────────┴──────┴──────────────────────────────────────────────────────────────┘
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|
Comments
Comment #2
SerShevchykdrupal-check modules/contrib/examples
222/222 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ ---------------------------------------------------------------------
Line cache_example/src/Form/CacheExampleForm.php
------ ---------------------------------------------------------------------
117 Call to deprecated function file_scan_directory():
in drupal:8.8.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\File\FileSystemInterface::scanDirectory() instead.
------ ---------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line phpunit_example/tests/src/Unit/AddClassTest.php
------ --------------------------------------------------------------------------------------
114 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------
Line phpunit_example/tests/src/Unit/ProtectedPrivatesTest.php
------ --------------------------------------------------------------------------------------
113 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
143 Call to deprecated method setExpectedException() of class Drupal\Tests\UnitTestCase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ --------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------------
Line stream_wrapper_example/tests/src/Kernel/StreamWrapperTest.php
------ -------------------------------------------------------------------------------
49 Call to deprecated method validScheme() of class Drupal\Core\File\FileSystem:
in drupal:8.0.0 and will be removed before Drupal 9.0.0. Use
Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::isValidScheme()
instead.
------ -------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------------------------------------
Line testing_example/src/Tests/NaiveConversionTest.php
------ ----------------------------------------------------------------------------------------------------------------
17 Class Drupal\testing_example\Tests\NaiveConversionTest extends deprecated class Drupal\simpletest\WebTestBase:
in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Instead,
use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340.
------ ----------------------------------------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------------------------------------------------
Line testing_example/src/Tests/SimpleTestExampleMockModuleTest.php
------ ----------------------------------------------------------------------------------------------------------------------------
32 Class Drupal\testing_example\Tests\SimpleTestExampleMockModuleTest extends deprecated class Drupal\simpletest\WebTestBase:
in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Instead,
use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340.
------ ----------------------------------------------------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------------------------------------------
Line testing_example/src/Tests/SimpleTestExampleTest.php
------ ------------------------------------------------------------------------------------------------------------------
31 Class Drupal\testing_example\Tests\SimpleTestExampleTest extends deprecated class Drupal\simpletest\WebTestBase:
in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Instead,
use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340.
------ ------------------------------------------------------------------------------------------------------------------
[ERROR] Found 8 errors
Comment #3
valthebaldDown to 7:
Comment #4
alt.dev CreditAttribution: alt.dev at DevBranch for Invotra Ltd commentedI ran the code analysis with the drupal-check version 1.0.14. Its return 18 errors.
I'm going to work on these failures on the DrupalCon Amsterdam 2019
Comment #6
mradcliffeAlso remember to add
core_version_requirement: ^8 || ^9
to all info.yml files.Comment #7
Kristen PolPer a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.
Comment #8
karthik.arumugam CreditAttribution: karthik.arumugam commentedI have removed the deprecated functions and updated the respective replacement functions. Please review.
Comment #9
andypost@karthik.arumugam please use child issues this meta supposed to coordinate other issues
interface cat't have method implmentations
Comment #10
Kristen PolMarked "Active" but looks like it should be "Needs work" based on last comment.
Comment #11
Kristen PolNever mind, I misunderstood. Sorry for the noise.
Comment #12
jungleComment #13
jungleUpdating IS
Comment #14
jungleTwo issues left
Comment #15
jungleCrediting everyone, and I think this was fixed. Thanks!
Comment #16
jungle