Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By I am learning on
Hi,
I think my template is badly designed :( I'm not getting any message, I checked by echoing the message directly and it appears but not using drupal_set_message.
Please advice.
Thanks and Regardds
Comments
Make sure you are printing
$messages
variable. i.e.if ($messages && $show_messages): print $messages; endif;
Mohammed J. Razem
http://www.vardot.com
Hi, Thanks for the reply. Its
Hi,
Thanks for the reply. Its already there in my template but the message does not appear.
and this is the function from signup_pay module that should display if a user has already paid, but it is not:function signup_pay_do_payment() {
global $user;
// Get method and node, from session
$nid = $_SESSION['signup_pay_nid'];
$method = $_SESSION['signup_pay_method'];
$anon = $_SESSION['signup_pay_anon_mail'];
// Check if user has already paid
if (signup_pay_check_payment($nid, $anon)) {
drupal_set_message(t('You have already paid for this event.'));
return;
}
// Check if it is Paypal
if ($method == SIGNUP_PAY_METHOD_PAYPAL) {
$data = array(
'uid' => $user->uid,
'nid' => $nid,
'mail' => $anon,
);
return signup_pay_do_paypal($data);
}
}
If I replace
drupal_set_message(t('You have already paid for this event.'));
with
echo 'You have already paid for this event'; exit;
it displays it. but it should display it through the function, unfortunately it is not.
Regards
Hey, I changed the theme to
Hey, I changed the theme to garland and I could see the message appearing. I'm sure my template is really badly designed.
What else can I check?
its a drupal 5 template and the code is:
if ($show_messages): print $messages; endif;
Regards.
It finally
It finally worked:
replaced
if ($show_messages): print $messages; endif;
with
if ($messages): print $messages; endif;
Thanks
Not work anonymous user side
It's work on admin and authentication user only. how to work anonymous user success message
Just cross-linking similar
Just cross-linking similar threads.
no message appear using drupal_set_message :-(
http://drupal.org/node/610400
drupal_set_message is not working for anonymous user
http://drupal.org/node/240726
Handling drupal_set_message for anonymous users
http://drupal.org/node/264132
Poll thank you message not working in Firefox
http://drupal.org/node/922558