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

Mohammed J. Razem’s picture

  1. Make sure you are printing the $messages variable. i.e. if ($messages && $show_messages): print $messages; endif;
  2. Try installing Better Messages module.


Mohammed J. Razem
http://www.vardot.com
Vardot

I am learning’s picture

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

I am learning’s picture

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.

I am learning’s picture

It finally worked:
replaced

if ($show_messages): print $messages; endif;

with

if ($messages): print $messages; endif;

Thanks

sadam 001’s picture

It's work on admin and authentication user only. how to work anonymous user success message

xjessie007’s picture

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