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()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GoZ created an issue. See original summary.

christophe.klein’s picture

Assigned: Unassigned » christophe.klein
GoZ’s picture

GoZ’s picture

Status: Active » Needs review

Damn you are fast @christophe.klein, i just see you assigned this to you. Sorry :/

christophe.klein’s picture

Assigned: christophe.klein » Unassigned

No problem :)

christophe.klein’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 5a481760a3 to 8.6.x and 98d7abe862 to 8.5.x. Thanks!

  • alexpott committed 8ba7326 on 8.6.x
    Issue #2984141 by GoZ: Remove @see drupal_get_messages() annotation in...

  • alexpott committed 98d7abe on 8.5.x
    Issue #2984141 by GoZ: Remove @see drupal_get_messages() annotation in...
alexpott’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.