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 |
---|---|---|---|
#20 | admin_toolbar-remove_deprecated-2958415-20-d8.patch | 4.28 KB | adriancid |
|
Comments
Comment #2
Prashant.cPatch needs to be reviewed.
Comment #3
harshita29 CreditAttribution: harshita29 at TO THE NEW commentedComment #4
harshita29 CreditAttribution: harshita29 at TO THE NEW commentedHi @Prashant.c
Your patch applied cleanly and it removed drupal_set_message by messenger service.Please refer the attached screenshot.
Comment #5
romainj CreditAttribution: romainj as a volunteer commentedNew patch to format correct PHP comments.
Comment #6
adriancidHi, @romainj and @eme as this is a change introduced in Drupal 8.5 I think that we need to make a decision.
We have users that can have a Drupal version < 8.5 and can make a module update to the latest version that will include this patch, in this case, the module will not works. I see two possible solutions, create a new branch 8.x-2.X or create a new release and add a note about the minimal Drupal Core version.
Comment #7
romainj CreditAttribution: romainj as a volunteer commentedI'd say that we should open a new branch. BUT we will possibly have to maintain the two for a long time which is hard work.
So is this patch really needed?
Comment #8
adriancid@romainj this will really matter in Drupal 9.0.0 as the function docblock now says:
We can keep the function and add a @TODO to the place where it used.
I'm trying to find others opinions in How to handle a core change that have an impact in your next release?
Comment #9
adriancid@romainj this is an answer on Slack from @berdir:
So I think that we can go ahead with this as once a new Core version is out the latest will not longer receive updates, so with this change we need to add to the info.yml file a core dependency like:
So here is the new patch :-) and the interdiff.
Comment #10
adriancidAnother update because an Interface should be used instead of a class when you're injecting services.
Interdiff between #5 and this patch is provided
Comment #11
romainj CreditAttribution: romainj as a volunteer commentedI think it is reasonable to wait until Drupal 8.6 so that everyone got enough time to update. Could we add a hook_requirements() to prevent upgrading the Admin Toolbar when using a Drupal version prior to 8.5?
Comment #12
adriancidWe really can commit this to the dev branch as we don't plane to made a release for the moment, and we can create a new release once the Drupal 8.6 version will be available.
Comment #13
romainj CreditAttribution: romainj as a volunteer commented@adriancid Yes you are right we have no rush to release a new version. Still I would prefer not to integrate the patch in the dev version now so that in case of a critical bug arises we are able to release a version without that patch. In any case we will take care of this issue as soon as we think it's time to.
Comment #14
adriancidComment #15
adriancidWe need to create a new patch before adding this functionality to the module because the ToolbarController class extends from ControllerBase class and in this class, we have the MessengerTrait trait, so we don't need to inject the service in ToolbarController, we need to use the MessengerTrait.
Similar issue in #2969630: Use the MessengerTrait instead of inject the messenger service
@romainj when do you think that we can put this into the dev version?
Comment #16
romainj CreditAttribution: romainj as a volunteer commented@adriancid I think that we should keep the actual 1.23 version compatible with all version of Drupal core and release a version 2 of Admin Toolbar compatible with Drupal core 8.5 and higher. As far as I know not every Drupal 8 sites upgrade to 8.5 version. So we don't want them to break when updating the Admin Toolbar.
Comment #17
romainj CreditAttribution: romainj as a volunteer commented@adriancid the patch #10 does not apply anymore.
Comment #18
romainj CreditAttribution: romainj as a volunteer commentedThe message when clearing all caches does not appear anymore.
Comment #19
romainj CreditAttribution: romainj as a volunteer commentedComment #20
adriancidHi @romain, as ToolbarController extends ControllerBase, and ControllerBase uses the MessengerTrait trait, we don't need to inject the messenger service.
Comment #21
adriancidHi @romainj with the new Drupal 8.5 do you think that is time to add this patch to the module oo we need to wait more?
Comment #22
romainj CreditAttribution: romainj as a volunteer commented@adriancid Yes I also think that it's time to commit the patch.
Comment #24
adriancid