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
Reviewing #2924538: [META] Remove all usages of drupal_set_message and drupal_get_messages, we still have a reference to drupal_get_messages()
in annotation of core/lib/Drupal/Core/Render/Element/StatusMessages.php::renderMessages().
We can remove the @see annotation or replace it by \Drupal\Core\Messenger\Messenger::deleteByType() since it's named in param description.
/**
* #lazy_builder callback; replaces placeholder with messages.
*
* @param string|null $type
* Limit the messages returned by type. Defaults to NULL, meaning all types.
* Passed on to \Drupal\Core\Messenger\Messenger::deleteByType(). These
* values are supported:
* - NULL
* - 'status'
* - 'warning'
* - 'error'
*
* @return array
* A renderable array containing the messages.
*
* @see drupal_get_messages()
*/
public static function renderMessages($type = NULL) {
Proposed resolution
Replace @see drupal_get_messages()
by \Drupal\Core\Messenger\Messenger::deleteByType()
Comment | File | Size | Author |
---|---|---|---|
#3 | 2984141-2-remove-drupal_get_messages-annotation.patch | 1012 bytes | GoZ |
Comments
Comment #2
christophe.klein CreditAttribution: christophe.klein at Actency commentedComment #3
GoZ CreditAttribution: GoZ at Iosan, Barbe-Rousse commentedComment #4
GoZ CreditAttribution: GoZ at Iosan, Barbe-Rousse commentedDamn you are fast @christophe.klein, i just see you assigned this to you. Sorry :/
Comment #5
christophe.klein CreditAttribution: christophe.klein at Actency commentedNo problem :)
Comment #6
christophe.klein CreditAttribution: christophe.klein at Actency commentedComment #7
alexpottCommitted and pushed 5a481760a3 to 8.6.x and 98d7abe862 to 8.5.x. Thanks!
Comment #10
alexpott