1

I'm using Commerce Auction module for an auction site. I want to display a message when the auction time out occurs for a certain product and at the same moment the user clicks on place bid tab.

Scenario:

  1. Created an auction item
  2. Started bidding with different users.
  3. When auction time out just occurs and at the same moment any user clicks on Place Bid tab that user is redirected to Access Denied page.

Now instead of redirecting to access denied page, how to display a message on the same page?

I have set a rule for mailing purpose on the same event. I also tried using "display message" rule for this event. But still it is displaying Access Denied message. I want to show different message only for this event.

1 Answer 1

0

1st attempt

Maybe the Disable Messages module can help here? Here is an excerpt from its project page:

Gives a site owner options to disable specific messages shown to end users. The core drupal message system as offered by drupal_set_message is an excellent way for modules to send out messages to the end users. However not all drupal site owners are keen to show all the messages sent out by drupal core and all modules to their users. This module gives site administrators a reasonably powerful way to filter out messages shown to the end users.

Some of its features which might help in this specific case:

  • Filter out messages that match a full text string exactly.
  • Filter out messages that match a regular expression.
  • Apply filtering only for specific paths.

2nd attempt

If the 1st attempt doesn't help, then you may want to try to expand the rule you already seem to have (as per your "I have set a rule for mailing purpose on the same event"). I.e by adding a rules action to flag the user (using the Flag module, with a flag you only use to indicate your scenario just happened to that user (let's say you label it "TimeOut").

Together with this, create an additional rule like so:

  • Rules Event: Drupal is initializing
  • Rules Conditions:
    • Current path matches your "no access" path (whatever that is in your case).
    • User is flagged with the "TimeOut"
  • Rules Actions:
    • Remove the "timeOut" flag (=unflag) for the current user.
    • Set your message.
    • Perform a redirect to a path that fits your needs.
2
  • I tried using this module. But it is still redirecting to the Access Denied page and showing the access denied message.
    – Akshay
    Commented May 14, 2015 at 7:47
  • Thanks for your edit. But we implemented some customizing (not from rules) to achieve it at that time. I will let you know when I implement it again.
    – Akshay
    Commented Sep 7, 2016 at 4:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.