#21533 closed defect (bug) (fixed)
Error suppression in wp-db is lame: Part 2
Reported by: | Viper007Bond | Owned by: | |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.4.1 |
Component: | Warnings/Notices | Keywords: | has-patch needs-unit-tests |
Focuses: | Cc: |
Description
Previously: #15402
This was fixed in [16321] however that was built upon [16320] and both were reverted in [16336] because it "Breaks things". What things it breaks I have no idea though (bad westi for not using a better commit message ;)). However I assume it was [16320] that broke things and not [16321].
[16321] seems perfectly valid to me and we should re-apply it along with a fix to __get()
that throws a warning when $result
isn't set yet.
Attachments (3)
Change History (16)
#5
in reply to:
↑ 3
;
follow-up:
↓ 6
@
12 years ago
Replying to westi:
From memory what this broke was HyperDB on WP.org
Checking if it was a resource was what broke it? Crazy...
#6
in reply to:
↑ 5
@
12 years ago
Replying to Viper007Bond:
Checking if it was a resource was what broke it? Crazy...
I guess westi was referring to [16320].
#7
@
12 years ago
Unit test added. It functions the same way as debug bar -- by spying on the error handler.
#10
follow-up:
↓ 11
@
12 years ago
I now get this notice on every admin page in trunk:
WARNING: wp-includes/wp-db.php:1079 - mysql_free_result() expects parameter 1 to be resource, boolean given
Since [21472], I get errors in Debug Bar:
Moved to
wpdb::flush()
,mysql_free_result()
now runs earlier than$this->result
is set:http://core.trac.wordpress.org/browser/trunk/wp-includes/wp-db.php?rev=21473#L1138
21533.patch fixes the warning.