Problem/Motivation
The old global functions drupal_get_message()
and drupal_set_message()
have been deprecated as of Drupal 8.5, which introduces the new \Drupal\Core\Messenger\Messenger
service. Compare https://www.drupal.org/node/2774931.
As OpenID Connect still has no stable release, and the old functions may be removed before Drupal 9, we should replace the used drupal_set_message()
calls by the new service for the first RC. (Which implies a dependency on Drupal Core 8.5+.)
Proposed resolution
Replace drupal_set_message()
calls by the new \Drupal\Core\Messenger\Messenger
service.
Remaining tasks
Create a patch.
User interface changes
None.
API changes
Dependency on Drupal Core higher than 8.5-alpha1.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#15 | openid_connect-replace-deprecated-drupal_set_message-2961752-15.patch | 4.56 KB | hirvinen |
Comments
Comment #3
Mario SteinitzComment #4
sunThis causes a fatal error on sites trying to install the module, as the required drupal/core version was not bumped to 8.5.0 in composer.json and the info file.
Comment #5
sunComment #6
sunComment #7
suncomposer.json was (accidentally) updated by #2961938: Move global module functions to a dedicated service class already… which is terribly confusing, but alas, yet another one of these issues sans reviews.
Comment #8
sunComment #10
Mario SteinitzReverted these changes. Attached please find a patch for this issue for review. I also created a new parent issue that allows to keeping track of changes that would add a dependency in Drupal Core 8.5+.
Comment #11
sunIt is still not possible to install 8.x-1.x right now.
HEAD is still broken, because a simple revert of this commit here did not remove all remnants of the messenger service, which was incorporated into #2961938: Move global module functions to a dedicated service class
Comment #12
sunAttached patch completes the revert.
Comment #13
Mario SteinitzAs we are at Core v8.7.1 right now, I strongly suggest moving on with changes that were postponed due to their dependency in Core 8.5+.
An updated patch attached.
Comment #14
hirvinen CreditAttribution: hirvinen at Exove commentedThe previous patches have some issues, such superfluous use MessengerTrait; (inherited from ControllerBase anyway), and not ensuring that the messenger has been acquired, leading to calling addError and addStatus on NULL. The attached patch fixes this and similar issue in OpenIDConnectedAccountsForm.
Comment #15
hirvinen CreditAttribution: hirvinen at Exove commentedFix patch filename format.
Comment #16
solideogloria CreditAttribution: solideogloria commentedI think this issue could be closed as a duplicate of #3112173: Drupal9 deprecations.
Comment #17
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedYes, it can.