Florian Loretan wrote:
On Thu, Apr 10, 2008 at 11:25 PM, Zohar Stolar <z.stolar@gmail.com <mailto:z.stolar@gmail.com>> wrote:
[...] On the other hand, there should be a way of selectively not displaying some or all messages, in a comfortable manner. How about a hook_message_alter? Has this ever been discussed?
I actually wrote a patch to add a hook_message_alter, but after some investigation it turned out not to be a viable solution. Among other issues, messages do not have a unique identifier that lets you target them individually, and errors in the implementations of the hook_message_alter hook only show up on the next page load. I guess the patch should include a modification of drupal_set_message, to add a unique message identifier. Such a method is used with drupal_mail, that forces a unique identifier for each out-going mail. However, modules don't usually send mails as often as they present messages, so this solution can be too hard to implement (imagine that you have to track all your messages, and give them unique ids... ). Adding messages to a modules would then become a nightmare. If we want to communicate with the users, then presenting them messages should stay an easy thing to do.
(I notice this thread is loosing contact with its subject... going back to the discussion about install messages:) Relating to what Earl mentioned before ("When installing a new module, I still have trouble figuring out what to do next"): In the efforts of making Drupal more user-friendly, I also think that the install messages can include a little notice of what to do next. For example: after enabling "blog" - have a link to the admin/content/types/blog after enabling "contact" - have a link to the admin/build/contact, and remind the user to activate the menu item after enabling "comment" - remind the user to check permissions, and configure individual content types settings etrc.