[RCD] Persistent messages

Marcus Don mdon at names.co.uk
Wed Jun 30 15:34:26 CEST 2010


Hi Alec

Thanks for your input. Did you see my later suggestion - ie to only populate
pending_message if it's not already defined?

The only potential drawback of your method I can see is that the plugin
would always be responsible for generating the error (ie there would be no
default), but I think this is reasonable. So, I have no preference - I'd
just like someone to update the source code so I don't have to maintain
another branch :)

Thanks

Marcus


> Maybe we just shouldn't display error messages when plugin uses abort?
> Plugin writers could call $OUTPUT->show_message() from the plugin. So
> 
> if ($plugin['abort'] || $DB->is_error()) {
>      if (!$plugin['abort'])
>          $OUTPUT->show_message('errorsaving', 'error', null, false);
> ...
> }
> 
>> My suggestion is simply to add an "abort_message" element to the $args
>> array, which can be checked by each of the action scripts. For example,
>> in save_identity.inc we just need to replace each occurrence of this...
>> 
>> else if ($plugin['abort'] || $DB->is_error())
>> $OUTPUT->show_message('errorsaving', 'error', null, false);
>> 
>> ...with this...
>> 
>> } else if ($plugin['abort'] || $DB->is_error()) {
>> if (isset($plugin['abort_message']) && $plugin['abort_message'] != '') {
>> $OUTPUT->command('display_message', $plugin['abort_message'], 'error',
>> false);
>> } else {
>> $OUTPUT->show_message('errorsaving', 'error', null, false);
>> }
>> }


_______________________________________________
List info: http://lists.roundcube.net/dev/



More information about the Dev mailing list