#53492 closed defect (bug) (fixed)
Fatal error serving media assets when `ms_files_rewriting` enabled
Reported by: | iandunn | Owned by: | iandunn |
---|---|---|---|
Milestone: | 5.8 | Priority: | high |
Severity: | blocker | Version: | 5.8 |
Component: | Media | Keywords: | has-patch has-unit-tests |
Focuses: | multisite | Cc: |
Description
r51211 introduced a fatal error for Multisites using ms-files.php
.
Uncaught Error: Call to undefined function
wp_image_editor_supports()
inwp-includes/functions.php
on line3306
ms-files.php
is loaded with SHORTINIT
, so media.php
never loads. Props @otto42, @barry, and @ryelle for help debugging.
To reproduce:
- Setup Multisite
svn up -r 51210
wp site option set ms_files_rewriting 1
- Setup rewrite rules, restart web service. e.g.,
location / { rewrite ^/([_0-9a-zA-Z-]+/)?files/$ /index.php last; rewrite ^/([_0-9a-zA-Z-]+/)?files/(.+) /wp-includes/ms-files.php?file=$2 last; }
- go to site that isn't main site
- upload new image
- view raw image, verify serving media from
/files/
. e.g.,https://foo.wp-develop.test/files/2021/06/pizza.jpg
svn up -r 51211
- change
error_reporting( 0 );
to1
inms-files.php
- refresh, the error should appear
cc @azaozz, @adamsilverstein, @desrosj
I'll start on a PR. Any ideas for the best approach?
Change History (8)
This ticket was mentioned in Slack in #meta by iandunn. View the logs.
3 years ago
This ticket was mentioned in Slack in #core by azaozz. View the logs.
3 years ago
This ticket was mentioned in PR #1421 on WordPress/wordpress-develop by iandunn.
3 years ago
#5
- Keywords has-patch added
r51211 accidentally introduced a fatal error for Multisite instances with ms_files_rewriting
enabled. Reverting removes the error, and the original purpose of the commit can be solved in another way.
Props azaozz.
Fixes #53492. See #53475.
SVN command for actual commit: svn merge -c -51211 .
, to preserve history etc
Trac ticket: https://core.trac.wordpress.org/ticket/53492
#6
@
3 years ago
- Owner set to iandunn
- Resolution set to fixed
- Status changed from new to closed
In 51223:
This ticket was mentioned in PR #1437 on WordPress/wordpress-develop by iandunn.
3 years ago
#8
- Keywords has-unit-tests added
Previously errors were not displayed or logged, but the original intention was only to prevent them from being displayed. Hiding them from logs makes problems like https://core.trac.wordpress.org/ticket/53492 much harder to debug.
This makes the handling of errors in ms-files
consistent with the REST API, admin-ajax
, and XML-RPC.
Trac ticket: https://core.trac.wordpress.org/ticket/53493
Ughh, was looking at the possibility that
wp_image_editor_supports()
is not defined, missed SHORTINIT though.Thinking best is to revert [51211]. #53475 can be fixed in a different way.