Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
SEE: http://drupal.org/node/49501
Steven fixed the earlier Ajax update failing on Fatal and Parse errors by using an ini_set('display_errors', 0).
This hides errors from developers as Dries note. The Ajax javascript stuff should be extended to report these errors.
Comment | File | Size | Author |
---|---|---|---|
#4 | update.fatal.error.patch | 9.13 KB | Steven |
Comments
Comment #1
dopry CreditAttribution: dopry commentedDries said in the aformentioned issue:
The update.php is not properly reporting errors anymore. I spent 45 minutes debugging a simple problem.
Update.php said: 'The update process did not complete. All errors have been logged. You may need to check the watchdog table manually.' but no errors were logged.
reproduction instructions? We need to know that we can fix this before you disappear on you wedding/honeymoon/escape from drupal.
Comment #2
Steven CreditAttribution: Steven commentedThe error reporting has nothing to do with ajax... outputting errors during the updating is bad whether JS is used or not. With the non-JS version, any extra output such as error messages only appears for a second anyway.
The real issue is that some or all errors are not being logged to the watchdog correctly.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedcould someone elaborate where the watchdog call is missing? error_handler() is not behaving properly. i will do whatever needs to be done if i get some guidance here.
Comment #4
Steven CreditAttribution: Steven commentedThis patch removes the last shreds of configuration dependency of update.php, and improves the handling of fatal errors. The main issue was that PHP does not pass most fatal errors through the custom error handler, so they were never logged in the watchdog. So I changed things around (again).
Note that fatal errors are only those that cause PHP to stop directly (parse error, non-existant function, memory/time limit, ...). These are mostly development mistakes. The vast majority of users will only encounter warnings (e.g. failed db queries) which were dealt with elegantly already.
Comment #5
Steven CreditAttribution: Steven commented-
Comment #6
neclimdulWFM. This seems to fix all the issues.
As a side note, the problem many of us had with watchdog not storing our errors wasn't entirely due to php not passing errors through the error handler. You will find that devel.module reverts drupals error_handler back to the default(look at devel_init). This is a quick debug feature when working on pages but is going to be undesirable on any ajax callback. This is what was probably the cause of the problem annoying Dries in the first place unless he was having a parsing error.
Comment #7
chx CreditAttribution: chx commentedI can only admire what Steven is cooking.
Comment #8
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedSeems to work fine, waiting for word from Neil.
Comment #9
rbrooks00 CreditAttribution: rbrooks00 commentedFWIW I think Neil is out till Wednesday unless someone has a more direct line to him.
Comment #10
Stefan Nagtegaal CreditAttribution: Stefan Nagtegaal commentedWorks perfectly for me! :-)
Comment #11
Gerhard Killesreiter CreditAttribution: Gerhard Killesreiter commentedapplied
Comment #12
(not verified) CreditAttribution: commented