Hello,
The current devel error handling options let you choose between the nice backtrace and the standard drupal message area, but I have had situations where I could really have done with both. Some themes do not display the backtrace the same in every situation and depending on what the page is doing it has been very useful to get both. Attached are a couple of screen shots.

I will add the patch too, and you can consider whether you like it. Obviously I will make a D7 patch too, but I was working on a D6 site when I needed this.

Jonathan

Files: 
CommentFileSizeAuthor
#19 _1163356_19.devel_.error_handler_option.patch3.37 KBjonathan1055
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#16 _1163356_16.devel_.error_handler_option.patch3.39 KBjonathan1055
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch _1163356_16.devel_.error_handler_option.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#10 _1163356_10.devel_.error_handler_option.patch3.51 KBjonathan1055
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch _1163356_10.devel_.error_handler_option.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]
#8 _1163356_8.devel_.error_handler_option.patch3.07 KBjonathan1055
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#6 _1163356_6.devel_.error_handler_option.patch2.7 KBjonathan1055
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#4 _1163356_4.devel_.error_handler_option.patch1.83 KBjonathan1055
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#2 _1163356_2.devel_.error_handler_option_d7.patch1.83 KBjonathan1055
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch _1163356_2.devel_.error_handler_option_d7.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
new error option - example.jpg505.73 KBjonathan1055
new error option - admin page.jpg89.3 KBjonathan1055

Comments

Yes, I've made the same experience. Please provide a patch for D7 first.

Version:6.x-1.24» 7.x-1.x-dev
StatusFileSize
new1.83 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch _1163356_2.devel_.error_handler_option_d7.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Here is the patch for D7 as requested, against the dev of 8th April. There are 3 chunks in .module and 1 in .admin.inc

Jonathan

Status:Active» Needs review

Please don't name it _d7, because that keeps the testbot from picking it up...

StatusFileSize
new1.83 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Sorry. I thought that _d7 was ok and it was -d7 which avoided the test bot. My mistake.

Status:Needs review» Needs work

+++ devel.module 2011-05-21 10:33:41.000000000 +0100
@@ -634,6 +636,11 @@ function backtrace_error_handler($error_
+        drupal_set_message(t('%error: %message in %function (line %line of %file).', $variables), $type[1]);

$type[1] is the error level (E_WARNING for example, which is 4), not the drupal_set_message() type ('warning' in this case).

+++ devel.admin.inc 2011-05-21 09:25:48.000000000 +0100
@@ -113,6 +113,7 @@ function devel_admin_settings() {
+    $form['devel_error_handler']['#options'][DEVEL_ERROR_HANDLER_BACKTRACE_AND_MESSAGE] = t('Backtrace plus standard drupal message');

Please spell "Drupal" with a capital "D" (and correct the other option, too).

Status:Needs work» Needs review
StatusFileSize
new2.7 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Yes, sure. Both messages now have capital D, and $type[1] replaced with 'error' as it is a real error condition not just a warning. I should have checked that.

Depending on the error_level() there could be warnings or notices, too. I'm sure someone will complain if we display these in bright red...

($type[1] <= WATCHDOG_ERROR ? 'error' : 'warning')

should do the trick (untested!).

StatusFileSize
new3.07 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

I realised that what we actually need is a conversion from the error_level to the drupal_set_message status value, so that the correct status and styling are used. I've added that into this patch, using a simple array

<?php
$message_status
= array(WATCHDOG_ERROR => 'error',
                       
WATCHDOG_WARNING => 'warning',
                       
WATCHDOG_NOTICE => 'warning',
                       
WATCHDOG_DEBUG => 'status');
?>

The actual values can be changed, this was just my initial mapping.

Yes, that would be the ultimate perfect solution, but it's too involved for this little feature, IMO. I think we'll be fine with WATCHDOG_DEBUG formatted as 'warning' (just not as 'error').

StatusFileSize
new3.51 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch _1163356_10.devel_.error_handler_option.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

Sorry, I seem to have forgotten about this. Yes, take your point about being too involved. Here is a patch with your simpler translation. Patched against dev of 28th Sept.

Status:Needs review» Needs work

The last submitted patch, _1163356_10.devel_.error_handler_option.patch, failed testing.

Status:Needs work» Fixed

Pushed to D8 and D7, thanks!

Please reopen if you want to post a patch for D6, too.

Hmm, that's funny! Until a few minutes ago, #10 was yellow (waiting), and now that I've pushed the patch (with a few minor tweaks), it just turned red.

Obviously, the patch cannot be applied a second time, but the timing is surprising...

Version:7.x-1.x-dev» 6.x-1.x-dev
Status:Fixed» Patch (to be ported)

From the error:

This may be a -p0 (old style) patch, which is no longer supported by the testbots.

Yes I made the patch with diff -up and I tested it by using patch -b -p0

There is obviously a better way I should be using, so that it is consistent with the new testbots. I'll have a look round to see if I can find it, unless you can tell me here ;-)

Yes I will do a D6 patch too.

I'm not up to speed with the subtleties of patching, I just use git diff and never had a problem.

I didn't have any problem applying your patch with git apply either, for that matter.

Status:Patch (to be ported)» Needs review
StatusFileSize
new3.39 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch _1163356_16.devel_.error_handler_option.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Here is the patch ported for D6, created against the 1.26 dev dated 13th Sept 2011.
There are many developers still working on existing D6 sites, so I hope you can commit this. Thanks
Jonathan

Status:Needs review» Needs work

The last submitted patch, _1163356_16.devel_.error_handler_option.patch, failed testing.

My patch failed to apply because the testbots do not accept p0 style patches any more, they only accept p1 style, as I found out via http://groups.drupal.org/node/140204

I do not have git installed, so does anyone know how I can make the required patches using diff?

Jonathan

Status:Needs work» Needs review
StatusFileSize
new3.37 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Manually editted patch file, just to see if this gets applied ok.

Status:Needs review» Fixed

Pushed to the -dev version, thanks!

Thank you.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.