Problem/Motivation

A number of deprecation errors are flagged by drupal-check against the 8.x-2.0 branch. In order to provide compatibility with Drupal 9, these errors should be fixed.

It should be noted that the deprecation errors are fixed on the 8.x-2.x branch through a major refactor, however, it's not clear if this major refactor is a breaking change or whether a release containing the refactor will ever be created; the last changes made to the dev branch were over a year ago.

Proposed resolution

Provide a patch to fix the deprecations for the stable 8.x-2.0 release.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jkswoods created an issue. See original summary.

jkswoods’s picture

Output generated by drupal-check:

 ------ ------------------------------------------
  Line   queue_ui.drush.inc
 ------ ------------------------------------------
  99     Call to deprecated function drush_log().
 ------ ------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   src/Form/QueueUIConfirmDeleteForm.php
 ------ ----------------------------------------------------------------------
  99     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/QueueUIOverviewForm.php
 ------ ----------------------------------------------------------------------
  331    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/QueueUIBatch.php
 ------ ----------------------------------------------------------------------
  90     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.
  99     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/QueueUIDatabaseQueue.php
 ------ -------------------------------------------------------------------------
  47     Call to deprecated function db_select():
         as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
         a database connection injected into your service from the container and
         call select() on it. For example,
  117    Calls to function kpr should not exist.
  167    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.
  182    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.
 ------ -------------------------------------------------------------------------
jkswoods’s picture

Patch for Drupal 9 support.

According to Acquia deprecation status, the error for Calls to function kpr should not exist. is uncategorised, and looking at the code it is not going to cause any problems as it relies on Devel to be enabled. tldr: kpr doesn't need to be removed to support Drupal 9

jkswoods’s picture

Assigned: jkswoods » Unassigned
Status: Active » Needs review
Eli-T’s picture

Issue tags: +Drupal 9 compatibility
jkswoods’s picture

Issue summary: View changes
Ankush_03’s picture

@jkswoods

Confirm base already have messenger dependency so you can directly use $this->messenger()->addMessage();

rather than

-19,12 +20,20 @@ class QueueUIConfirmDeleteForm extends ConfirmFormBase {

+ /**
+ * @var MessengerInterface
+ */
+ protected $messenger;
+
+

Ankush_03’s picture

Status: Needs review » Needs work
jkswoods’s picture

Issue summary: View changes
jkswoods’s picture

Issue summary: View changes
jkswoods’s picture

Status: Needs work » Needs review
FileSize
7.51 KB

Added patch to address #7.

jkswoods’s picture

bceyssens’s picture

Status: Needs review » Fixed

@jkswoods,

As you already mentioned, the refactored code has been available for testing for over a year. I just released a new version, ready for D9. Changes made during the refactor should cover all of the ones in your patch.

Status: Fixed » Closed (fixed)

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