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
Remove deprecated code to make this module compatible with D9.
Proposed resolution
------ ----------------------------------------------------------------------
Line content_lock.module
------ ----------------------------------------------------------------------
195 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line modules/content_lock_timeout/content_lock_timeout.module
------ ----------------------------------------------------------------------
92 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------
------ ------------------------------------------------------------------------------------------------------------------------------------------------------------
Line modules/content_lock_timeout/tests/src/Functional/ContentLockTimeoutTest.php
------ ------------------------------------------------------------------------------------------------------------------------------------------------------------
19 Usage of deprecated trait Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait in class Drupal\Tests\content_lock_timeout\Functional\ContentLockTimeoutTest:
in Drupal 8.8.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait instead.
------ ------------------------------------------------------------------------------------------------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/ContentLock/ContentLock.php
------ ----------------------------------------------------------------------
408 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
411 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
431 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
448 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
461 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
464 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------------------
Line src/Form/ContentLockSettingsForm.php
------ ----------------------------------------------------------------------------------
178 Call to deprecated method getLinkGenerator() of class Drupal\Core\Form\FormBase:
in drupal:8.0.0 and is removed from drupal:9.0.0. Inject the
------ ----------------------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/Form/EntityBreakLockForm.php
------ ----------------------------------------------------------------------
81 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
84 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------
------ -------------------------------------------------------------------------------------------------------------------------------------------------
Line tests/src/Functional/ContentLockTermTest.php
------ -------------------------------------------------------------------------------------------------------------------------------------------------
15 Usage of deprecated trait Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait in class Drupal\Tests\content_lock\Functional\ContentLockTermTest:
in Drupal 8.8.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait instead.
------ -------------------------------------------------------------------------------------------------------------------------------------------------
------ --------------------------------------------------------------------------------------------------------------------------------------------------
Line tests/src/Functional/ContentLockTestTrait.php (in context of class Drupal\Tests\content_lock\FunctionalJavascript\ContentLockJavascriptTestBase)
------ --------------------------------------------------------------------------------------------------------------------------------------------------
46 Call to method setUp() of deprecated class Drupal\Tests\BrowserTestBase:
in Drupal 8.6.x, will be removed before Drupal 9.0.0.
Use \Drupal\FunctionalJavascriptTests\WebDriverTestBase instead
------ --------------------------------------------------------------------------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line tests/src/FunctionalJavascript/ContentLockJavascriptTestBase.php
------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 Class Drupal\Tests\content_lock\FunctionalJavascript\ContentLockJavascriptTestBase extends deprecated class Drupal\FunctionalJavascriptTests\JavascriptTestBase:
in Drupal 8.6.x, will be removed before Drupal 9.0.0.
Use \Drupal\FunctionalJavascriptTests\WebDriverTestBase instead
------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------
[ERROR] Found 15 errors
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#4 | 3095055-4.patch | 30.86 KB | alexpott |
#4 | 2-4-interdiff.txt | 1.54 KB | alexpott |
#2 | 3095055-2.patch | 29.32 KB | alexpott |
Comments
Comment #2
alexpottThis resolves all the deprecated code usages found in the module. It results in the module only being compatible with ^8.8.0
Comment #3
chr.fritschThe test modules
content_lock_test
andprefetch_cache_test
are not D9 compatible because of core_version_requirement is missing.Besides that, to pass the tests we also need D9 versions of
prefetch_cache
andconflict
module.Comment #4
alexpottHere's a update for that. Hopefully at some point we can drop the testing module requirements because it feels OTT. I opened #3096609: Allow contrib test modules to not need a core or core_version_requirement key
Comment #5
chr.fritschThis looks pretty good to me. All tests are passing on Drupal 9 👍
I am going to create a 2.x branch now.
Comment #6
chr.fritschFixed in 8.x-2.x
Comment #8
chr.fritschComment #9
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.