Using drupal_set_message should be reserved to UI related code, like forms.

If an API function that can/would be called programmatically, it should not contain drupal_set_message because their is no guarantee that it is being called from the UI. So instead of putting the drupal_set_message call in the API function put it in the form function that is guaranteed to be called by the UI.

Examples can be found in the format plugins.

Comments

tom friedhof’s picture

Assigned: Unassigned » tom friedhof

Working on this refs #25833 in OA

tom friedhof’s picture

Assigned: tom friedhof » dragonwize
Status: Active » Needs review

This is done.

dragonwize’s picture

Version: » 7.x-1.x-dev
Status: Needs review » Fixed
tom friedhof’s picture

Status: Fixed » Closed (fixed)