Problem/Motivation

/**
 * Implements hook_install().
 */
function modal_page_install() {
  $messenger = \Drupal::messenger();
  $messenger->deleteAll();
  $messenger->addStatus(
    t('Module <em class="placeholder">Modal Page</em> has been enabled.')
  );
  $messenger->addStatus(t('Thanks for installing Modal Page'));
  $messenger->addStatus(t('You may create Modal by visiting <a href="@url_settings">@url_settings</a>', [
    '@url_settings' => Url::fromRoute('modal_page.default')->toString(),
  ]));
}

Delete all messages can be wrong, because of the Drupal feedback

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

thalles created an issue. See original summary.

thalles’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new742 bytes

Drupal messages do not duplicate messages of the same type and content

  • thalles committed 7653782 on 8.x-2.x
    Issue #3021439 by thalles: Clear all messages on install
    
thalles’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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