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
0answers
7 views

How to override confirmation messages when saving or updating/deleting content in Drupal 8?

I wanted to override status message after taxonomy term updated/deleted. I m trying to do with hook form alter as function atlas_common_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $...
0
votes
0answers
14 views

Proper way to *define* new menu status code for a custom module

What would be the proper way to define a new menu status code inside a custom module? I'm developing a module where a user can add family members which can register for events. In the same spirit as ...
0
votes
0answers
50 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 ...
0
votes
1answer
50 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-...
0
votes
1answer
43 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 ...
1
vote
2answers
388 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 ...
0
votes
1answer
276 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.
1
vote
2answers
213 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, ...
0
votes
3answers
290 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=="...
0
votes
2answers
39 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 ...
1
vote
1answer
26 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 ...
5
votes
0answers
488 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 ...
0
votes
1answer
50 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 ...
2
votes
2answers
421 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 "...
1
vote
1answer
972 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 (...
1
vote
1answer
186 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 = ...
0
votes
1answer
560 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 ...
1
vote
3answers
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 ...
0
votes
1answer
179 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-...
0
votes
2answers
82 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 ...
1
vote
2answers
2k views

How to change page not found page error message in drupal 8?

In my drupal 8 site I want to change my page not found page error message. Recently message showing like this "The requested page could not be found.". But I want show message like this "The requested ...
0
votes
1answer
34 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 ...
4
votes
1answer
1k 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 ...
0
votes
2answers
443 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 ...
4
votes
4answers
3k views

How do I change a system message programmatically in Drupal 8?

Hey there I want to change or hide a drupal message from the CommentForm class. In my entity_insert() hook I set a new message. I have an idea of how to do it but still no idea of where to do it. ...
0
votes
1answer
745 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 ...
0
votes
0answers
86 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 ...
3
votes
2answers
3k views

How to print status message on specific region or block? [closed]

See this picture i want also the status message or error message to display on header region not only on content region.
1
vote
2answers
751 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. ...
0
votes
2answers
357 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 ...
0
votes
1answer
20 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 ...
1
vote
1answer
226 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?
5
votes
8answers
8k 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 ...
0
votes
1answer
48 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, ...
0
votes
0answers
113 views

Is there an equivalent of drupal_set_message which will write to the block?

I have some custom functionality running in hook_block_view such that when a user loads a page, different status messages may need to be displayed from multiple blocks in the page. At present I am ...
1
vote
0answers
37 views

How do I delay error messages from firing until after a page is loaded [closed]

If anyone could please advise me on how to delay $messages from firing until after a page has loaded I would tremendously appreciate it. The issue I'm having is, users are filling out a form ...
2
votes
2answers
2k views

Error messages aren't displayed when submitting the form

I want to display an error message when I submit a form. I added an AJAX callback to the form, and the error message appears after I refreshed the page. I first tried the following code, but it doesn'...
1
vote
2answers
52 views

Site won't display messages

I'm desperate. I have a site with 2 databases, staging and production, and in staging messages set with drupal_set_messages() appear, but in production they don't. The codebase is the same. I tried ...
0
votes
0answers
27 views

How to set up a view that show only the log messages related to the node author

I'm trying to create a view similar to the Facebook notification that show all the log messages relative only to the node author. I'm working with message and rules and i've already set a view that ...
0
votes
0answers
17 views

Print success message only if field is altered [duplicate]

I have created a checkbox in user edit using form alter and based checkbox state I want to print the message. For this I used below code function module_form_user_profile_form_alter(&$form, &$...
1
vote
1answer
40 views

Customise Mollom status messages

I had a look around and couldn't see if this had been asked before so decided to create a new question. Please delete this if this is a duplicate. I'd like to customise the status messages that ...
1
vote
1answer
324 views

Add a message to messages array using theme process or preprocess function

For testing purposes, I'm trying to manually add a message to the $messages array, in either process or preprocess page function. To be clear, I first tried using template.php -> ...
3
votes
3answers
275 views

How to change Drupal's default “Unable to send e-mail.” message?

I wanted to override/change the text message that appears while sending Drupal mail. This is the text "Unable to send e-mail. Please contact the site administrator if the problem persists." What are ...
2
votes
1answer
986 views

How do I display a message after redirecting users from the logout page?

I'd like to show a message via drupal_set_message() after redirecting users from user/logout?destination=user. I tested this code but it doesn't work. if ($find) { drupal_set_message(t('This ...
2
votes
2answers
87 views

Does Drupal distinguish types of error messages?

In D7, under Configuration > Development > Logging and errors you can set "Error messages to display" to "none". However, I would think users should still be able to see form error messages, ...
1
vote
1answer
388 views

Remove duplicate messages

How to remove any duplicate messages of a certain type. For example when performing 2 searches using the search api module before rendering the page the message "To perform a search you must enter at ...
0
votes
1answer
272 views

show messages of drupal_get_form loaded forms in custom module

In my case I use drupal_get_form in my custom module in order to load forms from other modules and show them combined in one page (menu callback). So in my custom module I have function ...
1
vote
1answer
17 views

Can I show an image in place of a Drupal 6 message?

I have a form, that upon completion, goes back to the page it was called from and displays a message of success when everything is done. Is it possible to just display an image on that same page, or ...
0
votes
1answer
38 views

Is there any other way to create more secure link in a drupal_set_message?

Is there any other way to create more secure link in a drupal_set_message?? $loglink = l("bla bla", 'admin/config/services/blabla'); drupal_set_message(t("You should not have empty or the default ...
5
votes
1answer
693 views

How to show messages starting with “Debug : ” to an administrator only?

I'm developing a lot of complex rules in D7 and for debugging reasons it is very handy to have different messages (the standard Drupal message) within the website. For this I use "showing a message on ...