Questions tagged [status-messages]

Use it for questions about the queue of messages displayed to the client.

Filter by
Sorted by
Tagged with
0 votes
0 answers
30 views

How to change node add & update status messages? [duplicate]

Drupal 9.3 We need to dynamically change the output of the default "NODE_TYPE NODE_TITLE has been updated/created" status messages. What is the method for hooking into and changing specific ...
user avatar
0 votes
0 answers
68 views

Status messages don't show

I have a controller that manages a password reset form submit. Everything works fine, except for setting messages. I've tried to alter the message in the .module file too with no luck. It worked on ...
user avatar
  • 11
0 votes
1 answer
74 views

Drupal::messenger() not working in shutdown function

Some time I need to use a shutdown function. Here is a stupid example: ... drupal_register_shutdown_function('display_message'); ... function display_message() { Drupal::messenger()->addMessage('...
user avatar
  • 564
0 votes
0 answers
19 views

Overwrite/hook VBO action processed message

Googled so much for this and didn't find a way. I am using VBO to perform custom actions in my view. When a selected action has an error, I print the message using: \Drupal::messenger()->addWarning(...
user avatar
  • 33
0 votes
0 answers
23 views

Ajax message after node save

I am trying to add a Ajax Alert or popup message inside a hook_node_presave or hook_node_update, but it is not working. My current code look like this, but I have tried a lot of other ajax $response = ...
user avatar
3 votes
1 answer
406 views

Can we add custom CSS class in \Drupal::messenger()->addStatus()?

I did some research regarding adding custom CSS classes in the message but could not find the actual solution. As per Drupal 9 documentation: \Drupal::messenger()->addMessage(t($message)); public ...
user avatar
  • 129
1 vote
1 answer
617 views

Display status message after submitting modal popup form

Ok so i have a custom entity and want to display a custom delete form. Have created the Route and everything works except for Drupal messenger displaying status message after submission, even after a ...
user avatar
  • 194
0 votes
1 answer
51 views

Seeing PHP info twice in status report

On the status report page of a drupal site we run with 7.78, the PHP version number gets reported twice. We have only setup 1 PHP instance in IIS with version 7.3.24. How do I correct this to pull ...
user avatar
  • 113
0 votes
1 answer
303 views

Disable Inline Form Errors

I'm encountering the bug described at "Login form error message is redundant and does not make sense". In short, if a user enters invalid credentials once, an inline error message appears on ...
user avatar
0 votes
0 answers
33 views

Error non-numeric value encountered when edit type content

When I edit a type content published I receive the following error: THe fields in type content is: Maybe a problem in the php version? Drupal version: 7.75 PHP Version 7.1.24
user avatar
  • 143
2 votes
3 answers
331 views

Show form message only on initial load, but not after submit

I'm often using Drupal::messenger() to show status/warning messages before I submit the form. But those messages are usually counter-intuitive once the form has been submitted. How can I add a message ...
user avatar
  • 4,966
0 votes
1 answer
158 views

Is it possible to call response()->setStatusCode() within hook_theme_suggestions_page_alter?

We set up a custom error page theme by creating a block with the error text and then used the following code within a hook_theme_suggestions_page_alter implementation to determine when to override the ...
user avatar
  • 3,004
1 vote
1 answer
167 views

drupal_set_message doesn't display message sometimes

I'm uploading a file, to process and display a message at the end. However, the messages that drupal_set_message is set to display are displayed sometimes and don't display sometimes, even, if the ...
user avatar
1 vote
2 answers
720 views

Error: Private files directory not fully protected

I received the following error in my Drupal 8 status report: PRIVATE FILES DIRECTORY Not fully protected See https://www.drupal.org/SA-CORE-2013-003 for information about the recommended .htaccess ...
user avatar
0 votes
3 answers
2k views

Store custom messages displayed by \Drupal::messenger()->addMessage() in the database

In a custom module, I have the following code: \Drupal::messenger()->addMessage(t("Email changed to %email.", ['%email' => $new_email])); I issue more than a dozen different messages in this ...
user avatar
0 votes
1 answer
82 views

Modify the error message about the maximum upload file size

I would like to modify the default error message for the maximum upload file size, but I can't find the configuration. I looked at webform general settings, individual settings, and media file ...
user avatar
  • 3
0 votes
1 answer
147 views

How to show status messages in modal window?

Here, I tried many different ways to show status messages in pop window but was not able to get success in any way. So, basically i want to show all the status message of site in modal box whether it ...
user avatar
-3 votes
1 answer
200 views

I want to set some error message at one method and display it at another method [closed]

I have a method , here I set some message . function doSomeAction(){ $messenger = \Drupal::Messenger(); $messenger->addMessage('error msg',$messenger::TYPE_ERROR,true); $response = new ...
user avatar
  • 23
1 vote
2 answers
446 views

Display a message to user for empty user fields [closed]

User's have a field called "Location" (uses the Address module). I would like to show a message (or enable a block) to users that have not filled out this field. Specifically, this message should be ...
user avatar
  • 556
0 votes
0 answers
65 views

System message (after form submit) not clearing

Hope someone here can help me to find a solution to this. Here we go: Have created a custom theme for Drupal 8.6.9 In page--front.html.twig I created a custom region named "status_messages" which is ...
user avatar
0 votes
1 answer
594 views

Different Status Message templates for different pages

I have been trying to use different status message templates. But I do not know if we can use different status message templates for different pages. Is it possible? Right now, I am using status-...
user avatar
0 votes
1 answer
63 views

Showing a message for specific content type

I'm trying to show a message for specific content type through a new module, on Drupal 8.3.0. (I'm a beginner.) This is part of the code I am using. File test_module.module (updated code, still not ...
user avatar
1 vote
2 answers
2k views

How to remove status messages from admin theme?

I am working with Drupal 8. I have enabled "Seven" as admin theme. When I have added an image with high resolution I am getting 2 error messages at a time(screenshot). I want to hide "green" colored ...
user avatar
  • 109
0 votes
1 answer
390 views

Get the status message string

I tried to get the string messages and create a condition based on the string, but I don't know how to pull the string value. This is an example of message.
user avatar
1 vote
2 answers
441 views

How to override registration form message

I should override registration form message "Registration successful. You are now logged in." with String Overrides module it does not work, because new text is long and every line with other style, ...
user avatar
  • 19
0 votes
3 answers
847 views

Alter message status per content type

After hours trying to figure it out, no way ! What am I doing wrong ? function alter_appointment_message_form_node_form_alter(&$form,&$form_state,$form_id) { if($form['#node']->type=="...
user avatar
  • 355
0 votes
2 answers
43 views

Is there a way to add a timestamp to messages print from drupal_set_message()?

Sometimes when I am editing I may accidentally edit the same page in different tabs, or I might forget whether I have updated the page earlier or not. I use a Save and Edit button when saving and ...
user avatar
  • 1,269
1 vote
1 answer
37 views

How to include a field's suffix when using its Token?

My user accounts have an integer field Visits with the suffix visit|visits. It is very handy to let Drupal automatically decide which suffix is appropriate. I would now like to use this field in a ...
user avatar
  • 2,508
5 votes
0 answers
752 views

Login Failure Messages are not being shown [closed]

I am using Drupal 8 with the Bootstrap 3 theme. When a user on our site tries to log in unsuccessfully, no failure message are displayed. Is there something I can change anywhere in settings to show ...
user avatar
0 votes
1 answer
57 views

Can I set a status message to be displayed when a user clicks a link?

Here's my setup: I have a page about Pineapples. There is a link to the Pineapples page in the main navigation menu. When a user clicks that link, they go to the page. I also have a separate link ...
user avatar
2 votes
2 answers
1k views

Custom messages for user_pass_reset

I would like to customize the messages for one time login links (i.e. password reset links). In some cases, I redirect the user to the login page. In these cases, it does not make sense to have "...
user avatar
  • 373
1 vote
1 answer
2k views

Pass variables from one preprocess function to another in .theme

I am developing a theme in Drupal 8 and I have 2 twig files. One is page.html.twig and the other is status-messages.html.twig. The problem is that status-messages has a variable named message_list (...
user avatar
1 vote
1 answer
261 views

How to wrap Drupal "$messages" in a div?

How can I wrap $messages in a div using template.php file? This is my code: function THEME_status_messages($variables) { $display = $variables['display']; $output = ''; $status_heading = ...
user avatar
  • 13
0 votes
1 answer
758 views

drupal_set_message for anonymous user

I am having hard time displaying drupal message for anonymous users. My scenario is, I need to display message if there is certain query string and remove the query string with message. I am using ...
user avatar
  • 537
1 vote
2 answers
2k views

Why does drupal_set_message function encode all html tags?

Since I updated to Drupal 7.53 the function drupal_set_message does not work anymore as expected, as it encodes or strips all HTML tags. For example the code: drupal_set_message("<b>This is ...
user avatar
  • 2,008
0 votes
1 answer
254 views

How to stop drush displaying a Drupal error message?

This question is a follow-on from this one about creating managed files. If you look at the question in the link, you'll see that I am writing a drush command to detect all the inline-images in a just-...
user avatar
1 vote
2 answers
142 views

Is there a way to suppress warnings on the D8 Status Report page?

On my D8 status report (admin/reports/status) I have warnings about an issue I might wish to ignore. Is there any way to suppress the warnings on that report page once I have seen them and made my ...
user avatar
  • 305
2 votes
1 answer
3k views

How can I change the "page not found" message?

I want to change the page not found error message. Recently, message shows like The requested page could not be found. I want to show The requested page "/nvzmx,nvm,zxnv," could not be ...
user avatar
0 votes
1 answer
40 views

Prevent drupal_messages in drush

I am creating a bash script to automate some stuff including drush commands. When using drush vget I always get Drupal messages, but I only want the value of the variable. This prevents me from ...
user avatar
  • 131
4 votes
2 answers
2k views

how to check messages exists

I want to check is there any messages in my template in drupal 7 there was a global variable in page template variables messages now in drupal 8 I want to check is there any message but messages ...
user avatar
  • 21k
0 votes
2 answers
836 views

Rules: Display Message every first login per day; reset day 12:00am

I am trying to create a rule that will display a message to the user when (s)he logs in for the first time that day. Reset has to be per day at 12:00am. Notice: not the first time in 24 hours but ...
user avatar
  • 157
12 votes
7 answers
11k views

How can I programmatically change a system message?

I want to change or hide a message shown from the CommentForm class. In my entity_insert() hook I either unset $_SESSION['messages'] and add a new message or call drupal_get_message($type, TRUE). The ...
user avatar
  • 801
0 votes
1 answer
1k views

Unable to set drupal_set_message() after logout redirect [duplicate]

I want to show a message via drupal_set_message() after logout and redirects to page. Code: /* * Implements hook_user_logout(). */ function example_user_logout($account){ $login_message = 'You ...
user avatar
  • 3,608
0 votes
0 answers
104 views

Form error messages are not displaying in colorbox

I have a custom form which is displaying in a colorbox. But the problem is when I set an error in validate function using form_set_error, the red border appears against the field but the error ...
user avatar
  • 2,697
1 vote
2 answers
1k views

Display error message when validating form in a specified region or div

I have a Drupal 7 form, built by using Form API. I just want to validate using the hook_form_validate function, and if there are errors, display them using drupal_set_message. It is working perfectly. ...
user avatar
  • 932
0 votes
2 answers
363 views

Editing status message contents

I want to change the contents of a status message, it is being brought in via the commerce module (commerce_cart.rules.inc). The error message I want to change is: /** * Rules action: displays a the ...
user avatar
0 votes
1 answer
21 views

Display a message is not giving result? [closed]

I like to show a message on 1 page of my website after login. Therefore I made a rule. To determine the mobile device I use module : mobile_detect. I installed the corresponding library. Checking the ...
user avatar
  • 1,228
1 vote
1 answer
314 views

Webform A partially-completed form was found. Please complete the remaining portions

I'm seeing this message on my webforms: A partially-completed form was found. Please complete the remaining portions How can I suppress this message for Webform version 7.x-4.10?
user avatar
6 votes
8 answers
16k views

How do I redirect users and show a message?

I want to redirect users with RedirectResponse and display a message, but the message is not displayed. $response = new RedirectResponse($url); $response->send(); After little debugging I found ...
user avatar
  • 2,389
0 votes
1 answer
59 views

Cache error message

My Drupal 6 website has been working fine for many months. All of a sudden, it displays the following error messages: Warning: Can't find record in 'cache' query: SELECT data, created, headers, ...
user avatar
  • 2,788