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

CommentFileSizeAuthor
#4 3095055-4.patch30.86 KBalexpott
#4 2-4-interdiff.txt1.54 KBalexpott
#2 3095055-2.patch29.32 KBalexpott
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chr.fritsch created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
FileSize
29.32 KB

This resolves all the deprecated code usages found in the module. It results in the module only being compatible with ^8.8.0

chr.fritsch’s picture

Status: Needs review » Needs work

The test modules content_lock_test and prefetch_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 and conflict module.

alexpott’s picture

Status: Needs work » Needs review
FileSize
1.54 KB
30.86 KB

Here'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

chr.fritsch’s picture

Status: Needs review » Reviewed & tested by the community

This looks pretty good to me. All tests are passing on Drupal 9 👍

I am going to create a 2.x branch now.

chr.fritsch’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in 8.x-2.x

chr.fritsch’s picture

Kristen Pol’s picture

Issue tags: +Drupal 9 compatibility

Per 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.

Status: Fixed » Closed (fixed)

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