Fix the error reported by the Typecho plugin Comment2Mail

Original link: https://hsiaofeng.com/archives/243.html

After Typecho is updated, the email notification plug-in Comment2Mail will report an error and fail to send the email when replying.

The error message is as follows:

Argument 1 passed to Typecho\Widget::__construct() must be an instance of Typecho\Widget\Request, instance of Typecho\Request given, called in */usr/plugins/Comment2Mail/Plugin.php on line 173

After inquiry, someone has already asked a question in Typecho’s GitHub Issue, and joyqi ‘s solution is as follows:

Modify usr/plugins/Comment2Mail/Plugin.php : According to the number of lines provided by the error message (the error message line 173 mentioned above, so the number of lines is 173), the original code

 $widget = new Widget_Abstract_Comments(new Typecho_Request(), new Typecho_Response());

change into

 $widget = Widget_Base_Comments::alloc();

That’s it.

This article is transferred from: https://hsiaofeng.com/archives/243.html
This site is only for collection, and the copyright belongs to the original author.