Community & Support

no message appear using drupal_set_message :-(

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

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


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

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

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

---------
www.Maxi-Pedia.com Maxi-Pedia: Your resource for finance and IT!

nobody click here