Skip to main content

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
13 views

How do I get the "webform closed" status message to display when the status is set to "scheduled"?

I have a status message to display when a webform is closed (closed status message); however, it does not display when a form is currently closed but the status is set to "scheduled". It ...
Annie's user avatar
  • 1
0 votes
0 answers
40 views

Webform confirmation popup not displaying for custom template

I have a webform and I need to show a confirmation message in a popup. I enabled this option in the settings. I am using a custom template for the webform as suggested in twig. But after submitting ...
KTM's user avatar
  • 2,406
0 votes
0 answers
111 views

Change webform error status message

I'm working on making my webform on my site (D10) completely accessible. When I'm submitting my form empty I get a status message because I have two required fields. The message is: 2 errors have been ...
Joost's user avatar
  • 1,378
0 votes
0 answers
46 views

Why isn't Messenger working as expected in my submitForm?

I have this custom form (which is a tableselect): In the submitForm, there are two possible cases: The user has already made a reservation and a warning message is displayed: The user makes his ...
gbmapo's user avatar
  • 1,094
0 votes
1 answer
209 views

Why is my message not showing for anonymous user?

In a custom form, I have this Ajax submit: public function ajaxSubmit(array &$form, FormStateInterface $form_state) { $response = new AjaxResponse(); if ($form_state->hasAnyErrors()) ...
gbmapo's user avatar
  • 1,094
0 votes
1 answer
373 views

Show message after redirection

This will be mostly a Drupal question rather may not have any relation to Drupal commerce checkout. I have an Offsite Checkout redirect payment method in which I have a buildRedirectFrom as stated in ...
KTM's user avatar
  • 2,406
0 votes
0 answers
571 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 ...
Tobi's user avatar
  • 23
0 votes
1 answer
153 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('...
Baud's user avatar
  • 542
0 votes
0 answers
48 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 = ...
Tommy Styrbæk's user avatar
3 votes
1 answer
1k 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 ...
npcoder's user avatar
  • 129
1 vote
1 answer
2k 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 ...
Key's user avatar
  • 304
0 votes
1 answer
68 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 ...
P Joseph's user avatar
  • 113
0 votes
1 answer
1k 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 ...
sjhuskey's user avatar
0 votes
0 answers
42 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
vctlzac's user avatar
  • 163
2 votes
3 answers
1k 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 ...
Hudri's user avatar
  • 5,204
0 votes
1 answer
795 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 ...
Matt V.'s user avatar
  • 2,984
1 vote
1 answer
363 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 ...
user12824882's user avatar
1 vote
2 answers
2k 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 ...
glenviewjeff's user avatar
0 votes
3 answers
6k 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 ...
Marshall Morrise's user avatar
0 votes
1 answer
440 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 ...
kisa's user avatar
  • 3
0 votes
1 answer
362 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 ...
Abhishek Chauhan's user avatar
-3 votes
1 answer
935 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 ...
Arif's user avatar
  • 23
1 vote
2 answers
583 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 ...
ymdahi's user avatar
  • 664
0 votes
0 answers
112 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 ...
Daniel Soublett's user avatar
0 votes
1 answer
986 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-...
InspiredCoder's user avatar
0 votes
1 answer
95 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 ...
JustineHelfire's 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 ...
salu's user avatar
  • 119
0 votes
1 answer
469 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.
Oltus West's user avatar
1 vote
2 answers
535 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, ...
Evi's user avatar
  • 19
0 votes
3 answers
1k 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=="...
Aporie's user avatar
  • 375
0 votes
2 answers
46 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 ...
vfclists's user avatar
  • 1,269
1 vote
1 answer
51 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 ...
Jeroen's user avatar
  • 2,518
5 votes
0 answers
858 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 ...
user74400's user avatar
0 votes
1 answer
64 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 ...
Patrick Kenny's 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 "...
MrPeanut's user avatar
  • 383
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 (...
George Chanturia's user avatar
1 vote
1 answer
303 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 = ...
l00p's user avatar
  • 13
0 votes
1 answer
811 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 ...
cissharp's user avatar
  • 539
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 ...
user5950's user avatar
  • 2,048
0 votes
1 answer
320 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-...
Joel Guesclin's user avatar
2 votes
2 answers
177 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 ...
LeraA's user avatar
  • 325
2 votes
1 answer
4k 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 ...
Pankaj Yogi's user avatar
0 votes
1 answer
49 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 ...
bechtold's 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 ...
Yuseferi's user avatar
  • 22.2k
0 votes
2 answers
960 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 ...
Sammy7's user avatar
  • 157
12 votes
7 answers
14k 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 ...
DiDebru's user avatar
  • 861
0 votes
1 answer
2k 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 ...
Ajay Reddy's user avatar
  • 3,869
0 votes
0 answers
109 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 ...
Ahmad's user avatar
  • 2,845
1 vote
2 answers
2k 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. ...
Cesar's user avatar
  • 942
0 votes
2 answers
367 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 ...
Mark Whelan's user avatar