Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

报错,不知道什么原因! #2

Open
QAQ2077 opened this issue Mar 28, 2023 · 6 comments
Open

报错,不知道什么原因! #2

QAQ2077 opened this issue Mar 28, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@QAQ2077
Copy link

QAQ2077 commented Mar 28, 2023

Fatal error: Declaration of NewSmmsForTypecho_Plugin::deleteHandle(array $content) must be compatible with Widget\Upload::deleteHandle(array $content): bool in /www/wwwroot/lv7.cc/usr/plugins/NewSmmsForTypecho/Plugin.php on line 15
具体就这样,我也不知道!php7.3 难道是这个原因?

@ranlychan
Copy link
Owner

ranlychan commented Mar 28, 2023

初步排查可能是deleteHandle函数的返回类型与父类不相符导致的。在Typecho 1.2中返回类型应该为boolean而不是string,所以和父类的定义产生冲突而不相容。

    /**
     * 删除文件
     *
     * @access public
     * @param array $content 文件相关信息
     * @return string
     */
    public static function deleteHandle(array $content)

@ranlychan ranlychan self-assigned this Mar 28, 2023
@ranlychan ranlychan added the bug Something isn't working label Mar 28, 2023
@ranlychan
Copy link
Owner

这个问题是由于,插件暂时还不支持Typecho 1.2,在Typecho 1.1中的deleteHandle方法返回值为string,因此插件是可以正常运行的,而在1.2中deleteHandle返回值为boolean。

计划在后两个月适配到Typecho 1.2。

@ranlychan ranlychan added enhancement New feature or request and removed bug Something isn't working labels Mar 28, 2023
@QAQ2077
Copy link
Author

QAQ2077 commented Mar 28, 2023

好吧

@QAQ2077
Copy link
Author

QAQ2077 commented Mar 28, 2023

2023年了,我都没想到还有人用1.1的

@yanbinc
Copy link

yanbinc commented Oct 10, 2024

2024年了。。更新吧。。大哥

@MemoryCollection
Copy link

https://github.com/MemoryCollection/SmmsForTypecho

感谢作者分享,使用您的代码,针对1.2做了适配

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants