[development] Being noisy on installation...

Michael Favia michael at favias.org
Fri Apr 11 17:00:38 UTC 2008


Chad Phillips -- Apartment Lines wrote:
> 
> On Apr 11, 2008, at 1:37 AM, Earl Miles wrote:
> 
>> I'm not sure Views originated this technique; but then again, I'm not 
>> sure it didn't.
> 
> i'm pretty sure i was the first person to do this.  which either makes 
> me a visionary or a bastard depending on how you look at it...  ;)
Are the two really that mutually exclusive? How about both ;).

> my personal opinion is that core should be more informative about what 
> happens for something as important as a module installation.  without 
> the messages i currently hack into my own modules, the only way a user 
> knows anything happened at all is by scrolling down the mile long list 
> of checkboxes, and making sure that their module is now marked as 
> enabled -- lame.
Agreed. At the core of this discussion is the desire to determine the 
types of message communications that drupal has to communicate and how 
they should be handled. Here is my list of suggestions off the cuff:

1. Errors - these are php generated warnings and problems (e.g. mysql 
errors, missing directories/files, and foreach warnings) that have been 
caught by modules and forwarded to the msg queue system.

2. Status - These are regular messages that reflect or confirm the 
success of operations on users, content and settings in the system. 
(e.g. "Post created", and "setting set")

3. Information/instruction - The could be instructions for further 
inspection or for future consideration regarding operations like having 
installed a module (e.g. "You can configure this module <a>here</a>") or 
created a content type (e.g. "Add some fields by clicking on the add 
fields tab")

4. Extended/Debug - While many of us prefer debuggers sometimes it is 
nice to see an extended log of the operations that are important for 
quick diagnosis of the probelm or just to shepherd the process with al 
ittle more mental certainty that all went well. This wouldnt be a 
recreation of the devel module query log or anythign similar and would 
only show those "debug" messages that have been output by the modules 
that fired. (e.g. "Required tables created", "Imagecache tables and 
files purged")

These are the 4 main types of messages i can think of that i would like 
to get from drupal. I may have missed some, please correct if i have.

Following PHP's bitwise comparison operator and assigning these 
different message types simple integers that are able to be compared in 
a bitwise fashion opens up a number of opportunities for setting "site 
wide" (Admin > site information"), role wide (access permission?) or 
user specific (user edit page) output preferences for system messages.

define("DRUPAL_MESSAGE_ERROR" 1);
define("DRUPAL_MESSAGE_STATUS" 2);
define("DRUPAL_MESSAGE_INFORMATION" 4);
define("DRUPAL_MESSAGE_DEBUG" 8);

The line isnt always black and white and in the end it would be up to 
the developer of the module to decide what type of message one should be.

This is only a slight extension of the existing system and a 
formalization of the status types into constants but i think it solves a 
number of the issues if we implement the bitwise comparison operator 
message settings properly for users or roles if those are desired 
characteristics.

-- 
Michael Favia                   michael at favias.org
tel. 512.585.5650        http://michael.favias.org


More information about the development mailing list