no message appear using drupal_set_message :-(
rajoo.sharma - October 21, 2009 - 09:30
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

Make sure you are printing
$messagesvariable. i.e.<?phpif ($messages && $show_messages): print $messages; endif;
?>
Mohammed J. Razem
http://www.untitledstudios.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