#56906 closed defect (bug) (fixed)
Media Library Grid mode no media items shown if debug true
| Reported by: | ipajen | Owned by: | joedolson |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.1 |
| Component: | Media | Version: | 6.0.3 |
| Severity: | normal | Keywords: | php81 |
| Cc: | Focuses: |
Description (last modified by )
If WP_DEBUG is set to true in wp-config then Media Library Grid mode in wp-admin is not showing any media items (works fine in list mode), if disabling debug all media is shown in grid mode.
Note: Some deprecated warnings are shown, don't know if that is part of the problem that no media is shown
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /public_html/wp-includes/functions.php on line 7028 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /public_html/wp-includes/functions.php on line 2168
Attachments (1)
Change History (13)
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
4 years ago
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
4 years ago
#7
follow-up:
↓ 8
@
4 years ago
I can't reproduce this in WP 6.2-alpha-55155, and can't identify where those deprecated messages were coming from - the line numbers don't match up with anything relevant in 6.0.3, 6.0.2, 6.0.1, or 6.0.0.
@ipajen Can you confirm whether this issue still exists with no plugins active and a default theme?
#8
in reply to: ↑ 7
@
4 years ago
Replying to joedolson:
I can't reproduce this in WP 6.2-alpha-55155, and can't identify where those deprecated messages were coming from - the line numbers don't match up with anything relevant in 6.0.3, 6.0.2, 6.0.1, or 6.0.0.
@ipajen Can you confirm whether this issue still exists with no plugins active and a default theme?
Yes, Made a fresh install of WP 6.0.3, uploaded two pictures and enabled debug and the problem is still there with not showing any media items (works fine in list mode.
Deprecated: setcookie(): Passing null to parameter #5 ($domain) of type string is deprecated in /home/xxx/public_html/blog/wp-includes/option.php on line 1112 Deprecated: setcookie(): Passing null to parameter #5 ($domain) of type string is deprecated in /home/xxx/public_html/blog/wp-includes/option.php on line 1113
After upgrading to 6.1.1 no PHP warnings are shown and the Media items is shown correctly. So the part of PHP warnings are solved but I believe any warnings/Errors will trigger that the pictures in Media grid will not show. Maybe you can generate a warning that are shown in latest code to reproduce the problem that grid not shows the pictures if a debug warning is shown?
This ticket was mentioned in Slack in #core by costdev. View the logs.
4 years ago
#10
follow-up:
↓ 12
@
4 years ago
- Resolution → fixed
- Status assigned → closed
The underlying issue was fixed in [53490]. The issue of showing or hiding PHP errors during ajax requests is a wider discussion, and one I'm pretty sure we've had before. Hiding a PHP error is nearly always a bad idea as it makes debugging a nightmare. Production websites shouldn't be displaying errors anyway.
I'll close this as fixed. If I find a previous discussion about displaying errors in ajax requests I'll link it here.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
No media files shown in debug mode in grid