Make WordPress Core

Opened 16 months ago

Closed 12 months ago

Last modified 12 months ago

#56906 closed defect (bug) (fixed)

Media Library Grid mode no media items shown if debug true

Reported by: ipajen's profile ipajen Owned by: joedolson's profile joedolson
Milestone: 6.1 Priority: normal
Severity: normal Version: 6.0.3
Component: Media Keywords: php81
Focuses: Cc:

Description (last modified by sabernhardt)

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)

media.JPG (62.4 KB) - added by ipajen 16 months ago.
No media files shown in debug mode in grid

Download all attachments as: .zip

Change History (13)

@ipajen
16 months ago

No media files shown in debug mode in grid

#1 @sabernhardt
16 months ago

  • Description modified (diff)

#2 @SergeyBiryukov
16 months ago

  • Keywords php81 added

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


16 months ago

#4 @antpb
16 months ago

  • Milestone changed from Awaiting Review to 6.2

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


14 months ago

#6 @antpb
14 months ago

  • Owner set to joedolson
  • Status changed from new to assigned

#7 follow-up: @joedolson
13 months 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 @ipajen
13 months 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.


12 months ago

#10 follow-up: @johnbillion
12 months ago

  • Resolution set to fixed
  • Status changed from assigned to 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.

#11 @johnbillion
12 months ago

  • Milestone changed from 6.2 to 6.1

#12 in reply to: ↑ 10 @SergeyBiryukov
12 months ago

Replying to johnbillion:

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.

As of [36571] / #26262, PHP errors during Ajax requests are hidden by default.

Related: #36472, #36692.

Note: See TracTickets for help on using tickets.