Questions tagged [status-messages]

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

Filter by
Sorted by
Tagged with
-2
votes
0answers
35 views

Why are Drupal messages only showing on the homepage?

I am developing a module for a site in Drupal 8.9.12 but I see that all Drupal's messages are appear only in Home page and not in another page. I don't know how to resolve my problem because I don't ...
0
votes
0answers
28 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
0
votes
0answers
13 views

Permanent status/error/warning message on page

Background The Drupal 7 messages system works like this: drupal_set_message() adds a message (status, warning or error) to a message queue in the user session. When the page is rendered, theme('...
1
vote
3answers
130 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 ...
0
votes
1answer
28 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 ...
1
vote
1answer
60 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 ...
-2
votes
2answers
149 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 ...
0
votes
3answers
331 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 ...
0
votes
1answer
16 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 ...
0
votes
1answer
66 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 ...
-3
votes
1answer
73 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 ...
1
vote
2answers
280 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 ...
0
votes
0answers
52 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
311 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
57 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
1k 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
330 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
341 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
641 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
41 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
33 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
649 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
53 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
725 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
1k 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
239 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
689 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
2answers
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
230 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-...
1
vote
2answers
120 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 ...
2
votes
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
36 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
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 ...
0
votes
2answers
686 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 ...
10
votes
7answers
7k views

How do I programmatically change a system message?

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
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 ...
0
votes
0answers
99 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 ...
1
vote
2answers
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. ...
0
votes
2answers
362 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
283 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?
6
votes
8answers
13k 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
54 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
133 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
38 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
42 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 ...