问题:

插件 ExSearch在TP1.2 开发版配合主题最新开发版中,重建索引报错:Argument 1 passed to Typecho\Widget::__construct() must be an instance of Typecho\Widget\Request, instance of Typecho\Request given, called in /www/wwwroot/demo/usr/plugins/ExSearch/Plugin.php on line 276

 

解决:

重建索引的错误需要把ExSearch插件目录下的Plugin.php的276行改为$widget = $className::alloc(); 不需要之前那个很长的声明了。然后就好了

    $className = "Widget_Abstract_{$table}";
    $key = $keys[$table];
    $db = Typecho_Db::get();
    $widget = $className::alloc();   #就是改这行就行
        
    $db->fetchRow(
        $widget->select()->where("{$key} = ?", $pkId)->limit(1),
            array($widget, 'push'));
    return $widget;
}

 

参考:

https://github.com/AlanDecode/Typecho-Theme-VOID/issues/87