mihdan / mihdan-yandex-turbo-feed

Плагин под WordPress, генерирующий ленту (фид) для Турбо-страниц от компании Яндекс.
https://wordpress.org/plugins/mihdan-yandex-turbo-feed/
GNU General Public License v3.0
17 stars 5 forks source link

disable_dev_mode() must be an instance of ReduxFramework #38

Closed mihdan closed 5 years ago

mihdan commented 5 years ago

После обновления WP до последней версии, сайт перестал работать. Trace ошибки:

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Mihdan_Yandex_Turbo_Feed_Settings::disable_dev_mode() must be an instance of ReduxFramework, instance of given, called in /var/www/wp-includes/class-wp-hook.php on line 286 and defined in /var/www/wp-content/plugins/mihdan-yandex-turbo-feed/includes/class-mihdan-yandex-turbo-feed-settings.php:18, referer: https://www.site.com/

Stack trace:, referer: https://www.site.com/

stderr: #0 /var/www/wp-includes/class-wp-hook.php(286): Mihdan_Yandex_Turbo_Feed_Settings->disable_dev_mode(Object(ReduxCore\ReduxFramework\ReduxFramework)), referer: https://www.site.com/

stderr: #1 /var/www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array), referer: https://www.site.com/

stderr: #2 /var/www/wp-includes/plugin.php(465): WP_Hook->do_action(Array), referer: https://www.site.com/

stderr: #3 /var/www/wp-content/plugins/accelerated-mobile-pages/includes/options/redux-core/framework.php(317): do_action('redux/construct', Object(ReduxCore\ReduxFramework\ReduxFramewo in /var/www/wp-content/plugins/mihdan-yandex-turbo-feed/includes/class-mihdan-yandex-turbo-feed-settings.php on line 18, referer: https://www.site.com/

Времени разбираться нет, пришлось, вручную убрать тип в функции:

/**
     * Отключаем режима разработки
     *
     * @param ReduxFramework $redux
     */
    public function disable_dev_mode( $redux ) {
            if (is_object($redux) && $redux instanceof ReduxFramework) {
                $redux->args['dev_mode'] = false;
                $redux->args['forced_dev_mode_off'] = false;
            }
    }

Если это глобальная проблема, исправьте пожалуйста

P.S. PHP 7.2.5

https://wordpress.org/support/topic/disable_dev_mode-must-be-an-instance-of-reduxframework/

mihdan commented 5 years ago

https://github.com/mihdan/mihdan-yandex-turbo-feed/commit/eae1bd309d8b07b422a997b9d303485cdb1a5139