Jump to content

Suppressing Module notices


Mackski
 Share

Recommended Posts

I'm using $session->message and $session->error for my front end.

When using FieldtypeMapMarker module, a message displays after succesfully geocoding an address.
(Which I want to suppress from the front end)

Is this possible?
Better still could the message and error functions allow an aditional boolean to signify a different intended use?:

eg:
 

$session->message('Well done!', Notice::frontEnd);

// or user defined
$session->error('Sorry, Broken!', 'MyMessages'); 
Link to comment
Share on other sites

Thanks Lost, after digging through the code it's quite obvious.
 

Adding this worked:

$session->message('Saved', true); 

Then just check when generating the notice messages:

foreach($notices as $notice) {

    if($notice->flags > 1) continue; // only process front end notices
    
    // display notices...
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...