Make WordPress Core

Opened 5 weeks ago

Closed 5 weeks ago

Last modified 3 weeks ago

#63285 closed defect (bug) (fixed)

Call to undefined function is_super_admin() in /wp-includes/ms-files.php

Reported by: verygoode's profile verygoode Owned by: peterwilsoncc's profile peterwilsoncc
Milestone: 6.8.1 Priority: normal
Severity: major Version: 6.8
Component: Networks and Sites Keywords: dev-reviewed fixed-major
Focuses: multisite Cc:

Description

After the release of 6.8, we have observed fatals across certain multisites.

Specifically, when certain files are requested. E.g., /example/files/2014/01/img_1234.jpg which reults in HTTP 500 and the fatal error below.

PHP Fatal error:  Uncaught Error: Call to undefined function is_super_admin() in /wordpress/core/6.8/wp-includes/ms-files.php:23
Stack trace:
#0 {main}
  thrown in /wordpress/core/6.8/wp-includes/ms-files.php on line 23

This appears related to https://core.trac.wordpress.org/changeset/59967

ms-files.php leverages define( 'SHORTINIT', true ); which makes is_super_admin() unavailable.

Props @jmdodd for noticing the bump in related fatals.

Change History (18)

#1 @desrosj
5 weeks ago

  • Milestone changed from Awaiting Review to 6.8.1

Hi @verygoode,

You say "certain multisites". Have you identified anything in common so far with the ones that experience this problem?

Last edited 5 weeks ago by desrosj (previous) (diff)

#3 @jorbin
5 weeks ago

wp-includes/capabilities.php can't be loaded with SHORTINT. I think we will need to revert [59967]

#4 @jeremyfelt
5 weeks ago

This looks like it will fatal on anything still using ms-files for media, so any WP multisite created before 3.5 and not manually converted after.

I think we will need to revert [59967]

Heavy plus one.

#5 @audrasjb
5 weeks ago

Yes I also think the best option is to revert this changeset.

This ticket was mentioned in PR #8694 on WordPress/wordpress-develop by @jorbin.


5 weeks ago
#6

  • Keywords has-patch added

#7 @jorbin
5 weeks ago

  • Keywords needs-patch added; has-patch removed

Based on this only affecting older multisites or multisites that have manually converted to use ms-files, I think we don't need to rush 6.8.1 out the door.

@verygoode If you are looking to update your multisite to take advantage of the removal of ms-files from 2012, https://halfelf.org/2012/dumping-ms-files/ may be helpful.

#8 @jorbin
5 weeks ago

  • Keywords has-patch needs-testing added; needs-patch removed

#9 @johnjamesjacoby
5 weeks ago

  • Keywords needs-patch added; has-patch needs-testing removed

#63104 is another ms-files.php related ticket, opened on March 15.

Only noting here because it seems highly coincidental.

#10 @peterwilsoncc
5 weeks ago

  • Owner set to peterwilsoncc
  • Resolution set to fixed
  • Status changed from new to closed

In 60170:

Media: Prevent Multisite fatal error in legacy file rewrites.

Removes a call to the is_super_admin() function in ms-files.php as the function isn't available when using the SHORTINIT feature, causing fatal errors on systems using file rewrites.

Reverts [59967].

Props audrasjb, desrosj, jeremyfelt, johnjamesjacoby, jorbin, presskopp, verygoode, dd32, joemcgill.
See #36803.
Fixes #63285.

#11 @peterwilsoncc
5 weeks ago

  • Keywords dev-feedback added; needs-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from trunk to 6.8

Reopening for merging [60170] to the 6.8 branch pending another committers review.

This ticket was mentioned in Slack in #core by jorbin. View the logs.


5 weeks ago

#13 @jorbin
5 weeks ago

  • Keywords dev-reviewed fixed-major added; dev-feedback removed

[60170] looks good to backport to the 6.8 branch.

#14 @peterwilsoncc
5 weeks ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 60171:

Media: Prevent Multisite fatal error in legacy file rewrites.

Removes a call to the is_super_admin() function in ms-files.php as the function isn't available when using the SHORTINIT feature, causing fatal errors on systems using file rewrites.

Reverts [59967].

Reviewed by jorbin.
Merges [60170] to the 6.8 branch.

Props audrasjb, desrosj, jeremyfelt, johnjamesjacoby, jorbin, presskopp, verygoode, dd32, joemcgill.
See #36803.
Fixes #63285.

#15 @neo2k23
4 weeks ago

I have the same issue in my multisite that all images are missing in some of the subsites.

But not in all of the subsites. Only some are affected. But the behaviour is not consistent and weird.

First almost all sub websites were affected by this.

Then i restored the complete server and retried and some were ok and some were not. But i had more that were ok than the first time i upgraded wp to 6.8.

I tried again a full restore and got even more websites that were ok. Only 3 left with missing images.

Reverting line 24 in ms-files.php to what it was in wp 6.7.2 fixes the issue for the remaining 3 websites.

     if ( '1' === $current_blog->archived || '1' === $current_blog->spam || '1' === $current_blog->deleted ) {

#16 follow-up: @pgsmarketing
4 weeks ago

Thanks to @neo2k23 - that temporary fix helped my multisite.

#17 in reply to: ↑ 16 @neo2k23
4 weeks ago

Replying to pgsmarketing:

Thanks to @neo2k23 - that temporary fix helped my multisite.

it is not my fix.. i just followed above instructions posted by @audrasjb in this link

https://core.trac.wordpress.org/changeset/59967

for which i am gratefull as it fixed the problem.

#18 @jorbin
3 weeks ago

6.8.1 RC1 is now available for testing and includes a fix for this issue. Please help test before the final release https://make.wordpress.org/core/2025/04/28/wordpress-6-8-1-rc1-is-now-available/

Note: See TracTickets for help on using tickets.