Problem/Motivation

The Term Merge module uses a few pieces of code that have been deprecated in Drupal core, specifically:

  • \Drupal\user\PrivateTempStoreFactory is scheduled for removal in Drupal 9.0.0. Use \Drupal\Core\TempStore\PrivateTempStoreFactory instead. See https://www.drupal.org/node/2935639.
  • \Drupal\user\PrivateTempStore is scheduled for removal in Drupal 9.0.0. Use \Drupal\Core\TempStore\PrivateTempStore instead. See https://www.drupal.org/node/2935639.
  • drupal_set_message() is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead. See https://www.drupal.org/node/2774931

Proposed resolution

Replace the deprecated code with the new code suggested by Drupal core.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idebr created an issue. See original summary.

mahtab_alam’s picture

Patch for drupal_set_message

idebr’s picture

Status: Active » Needs review
idebr’s picture

#2 Thanks for starting to work on a patch! This patch replaces the remaining deprecated code with the new code suggested by Drupal core.

legolasbo’s picture

Thanks for working on this, but given the fact that 8.5 hasn't been out that long and many sites might not be up to date I'm going to hold off on committing this for a while. This is because I don't want to break backwards compatibility for existing installations and I don't feel this warrants opening and maintaining a 2.x branch just yet.

idebr’s picture

Status: Needs review » Postponed

#5 Fair enough. Let's re-evaluate once 8.6.0 has been released.

legolasbo’s picture

Status: Postponed » Needs review
FileSize
3.3 KB

Support for Drupal 8.5 has been dropped with the release of Drupal 8.7, this means that it's now safe to remove the usages of the deprecated methods. Unfortunately the patch did not apply anymore, so I had to redo the changes on the current codebase. Let's see what testbot thinks of this.

idebr’s picture

Attached patch replaces the deprecated \Drupal\user\PrivateTempStoreFactory with the \Drupal\Core\TempStore\PrivateTempStoreFactory

Status: Needs review » Needs work

The last submitted patch, 8: 2980633-8.patch, failed testing. View results

idebr’s picture

Status: Needs work » Needs review
FileSize
1.59 KB
7.97 KB

Missed an occurrence.

  • legolasbo committed 2e88a85 on 8.x-1.x authored by idebr
    Issue #2980633 by idebr, legolasbo, mahtab_alam: Replace usage of...
legolasbo’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

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