If you call trigger_error('Some message')
in your code (thereby trigger a message with the default E_USER_NOTICE error type), it will get displayed to the screen as if it is a debug message generated with the debug() function (in other words, it will have the word "Debug" out front, will display as a green status message rather than a red error message, etc).
That behavior was introduced in #296574: Provide debug facility for general and testing (with some reservations) as a means of getting debug() to behave properly.
Currently it is causing me some issues with the patch in #2844716: "Missing/moved modules" PHP warnings should be PHP notices instead.
I think the solution is to use a method similar to https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/_drupa... to indicate that only the messages triggered by the debug() function should be displayed as debug messages.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2844732-4.patch | 5.28 KB | David_Rothstein |
#3 | 2844732-3.patch | 1.26 KB | David_Rothstein |
Comments
Comment #2
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedComment #3
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedHere is a patch.
I guess ideally it would have tests, but I don't really have the inclination to write them at the moment.
Comment #4
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedHm, it actually may be a bit more complicated than the above. There is duplicate code elsewhere that does the same thing, and also code in the tests that seem to rely on it.
Here's a new version of the patch that I think may be complete this time.
Comment #17
quietone CreditAttribution: quietone at PreviousNext commentedThis is a Bug Smash daily triage issue.
errors.inc has the following but there is no explanation why a 'User notice' is to be treated as debug information.
Git blame says that this was introduced in #325169: Move error/exception handler higher up in the bootstrap process but that is not right. The change is not there. The IS has #2844716: "Missing/moved modules" PHP warnings should be PHP notices instead and looking there, the patch has:
I don't know what _drupal_trigger_error_with_delayed_logging' is and so still don't know why 'User notice' are treated as debug in the UI.