首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >调用未定义函数upload_is_user_over_quota()

调用未定义函数upload_is_user_over_quota()
EN

WordPress Development用户
提问于 2018-08-30 06:28:14
回答 1查看 883关注 0票数 -1

我有两个不同的多站点:

  • www.example.org
  • www.example-two.org

在这两个站点上,都有5个子站点。

它们托管在同一台服务器上(我已经使用VirtualMin安装了该服务器)。所有10个子网站都有相同的父主题,不同的子主题也有细微的变化。

我已经把网站转换成古腾堡了,但是每当我上传一张图片,我就会得到这样的错误:

The response is not a valid JSON response.

..。在这里看到:

在错误日志中,我得到了以下错误:

代码语言:javascript
复制
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Call to undefined function upload_is_user_over_quota() in /PATH/TO/FOLDER/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php:808, referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit

下面是整个堆栈跟踪:

代码语言:javascript
复制
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Call to undefined function upload_is_user_over_quota() in /PATH/TO/FOLDER/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php:808, referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: Stack trace:, referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #0 /PATH/TO/FOLDER/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php(734): WP_REST_Attachments_Controller->check_upload_size(Array), referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #1 /PATH/TO/FOLDER/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php(108): WP_REST_Attachments_Controller->upload_from_file(Array, Array), referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #2 /PATH/TO/FOLDER/wp-includes/rest-api/class-wp-rest-server.php(936): WP_REST_Attachments_Controller->create_item(Object(WP_REST_Request)), referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #3 /PATH/TO/FOLDER/wp-includes/rest-api/class-wp-rest-server.php(321): WP_REST_Server->dispatch(Object(WP_REST_Request)), referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #4 /PATH/TO/FOLDER/wp-includes/rest-api.php(266): WP_REST_Server->serve_request('/wp/v2/media'), referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #5 /PATH/TO/FOLDER/wp-inclu in /PATH/TO/FOLDER/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php on line 808, referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit

看起来其他 体验这个错误也是如此。

有人知道解决办法或解决办法吗?

EN

回答 1

WordPress Development用户

回答已采纳

发布于 2018-08-30 10:31:57

在挖掘过程中,这似乎是一个bug,在4.9.8中添加了WordPress。这个补丁似乎在Multisite上通过REST上传了中断的附件,因为它使用了一个来自未加载REST请求的文件中的函数。

我已经报告了窃听器这里

一个快速而肮脏的解决方法是将其添加到主题的functions.php文件中,或者是一个简单的插件:

代码语言:javascript
复制
if ( ! function_exists( 'upload_is_user_over_quota' ) ) {
    function upload_is_user_over_quota( $echo ) {
        return false;
    }
}

这个函数不会做它应该做的事情,但是它将防止致命的错误发生。

票数 1
EN
页面原文内容由WordPress Development提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://wordpress.stackexchange.com/questions/312859

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档