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.
drupal_set_message() has been deprecated in favor of the messenger service.
Comment | File | Size | Author |
---|---|---|---|
#8 | interdiff_6-8.txt | 1.05 KB | Prashant.c |
#8 | deprecated-drupal-set-message-2958710-8.x-3.x-dev-8.patch | 3.9 KB | Prashant.c |
#6 | Extend Drupal 8.6.x.png | 35.9 KB | Prashant.c |
#6 | deprecated-drupal-set-message-2958710-8.x-3.x-dev-6.patch | 3.83 KB | Prashant.c |
| |||
#2 | deprecated-drupal-set-message-2958710-8.x-2.x-dev-2.patch | 3.88 KB | Prashant.c |
|
Comments
Comment #2
Prashant.cPatch needs to be tested and reviewed.
Comment #4
gbyte CreditAttribution: gbyte as a volunteer and commentedThanks, but I would rather implement this after core 8.6 comes out, as this seems to be a new service which won't work prior to 8.5. Lots of people are still on core < 8.5.
Comment #5
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedFeel free to port the patch to 8.x-3.x, I will gladly review and commit.
Comment #6
Prashant.c@gbyte.co
I have submitted patch for 8.3.x and tested it locally for installation message which seems to be working fine.
Putting this in Review so that other scenarios can be tested.
Comment #7
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedComment #8
Prashant.c@gbyte.co
using
use Drupal\Core\Messenger\MessengerInterface
instead ofuse Drupal\Core\Messenger\Messenger
But iam not able to figure out why it throwing error
Comment #10
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commented@Prashant.c It failed because you were trying to inject the new service through the static create function, but that's how you would usually do it in a controller or plugin context. In services you usually inject other services into the constructor through the services file, see the commit above.
Comment #12
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedForgot to commit the Logger class. :|