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
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
- Write a patch
- Review
- Commit
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#10 | 2980633-10.patch | 7.97 KB | idebr |
| |||
#10 | interdiff-8-10.txt | 1.59 KB | idebr |
Comments
Comment #2
mahtab_alam CreditAttribution: mahtab_alam at Valuebound commentedPatch for drupal_set_message
Comment #3
idebr CreditAttribution: idebr at ezCompany commentedComment #4
idebr CreditAttribution: idebr at ezCompany commented#2 Thanks for starting to work on a patch! This patch replaces the remaining deprecated code with the new code suggested by Drupal core.
Comment #5
legolasboThanks 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.
Comment #6
idebr CreditAttribution: idebr at ezCompany commented#5 Fair enough. Let's re-evaluate once 8.6.0 has been released.
Comment #7
legolasboSupport 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.
Comment #8
idebr CreditAttribution: idebr at ezCompany commentedAttached patch replaces the deprecated
\Drupal\user\PrivateTempStoreFactory
with the\Drupal\Core\TempStore\PrivateTempStoreFactory
Comment #10
idebr CreditAttribution: idebr at ezCompany commentedMissed an occurrence.
Comment #12
legolasboCommitted and pushed to 8.x-1.x. Thanks!