Status messages not printing in hook_user_presave

Created on 1 March 2024, 10 months ago
Updated 16 March 2024, 9 months ago

Problem/Motivation

Steps to reproduce

Drupal 9.5
In a Custom module I used to print status messages

function mymodule_user_presave(\Drupal\user\UserInterface $account) {
\Drupal::messenger()->addMessage(''Successful message.'', 'status', TRUE);
\Drupal::messenger()->addStatus(t('Successful message.'));
}

None of these messages are print in the user edit page
But when i tried saving with validation errors those are printed (below image)


https://www.drupal.org/files/issues/2024-03-01/Screenshot%202024-03-01%2...

🐛 Bug report
Status

Fixed

Version

11.11

Component

Code (back-end)

Created by

🇱🇰Sri Lanka SajithAthukorala

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024