致命错误:未捕获的异常'异常'带有消息'非法小部件设置ID

时间:2018-03-21 19:08:07

标签: wordpress

我最近注意到,当我尝试加载外观>自定义我收到此错误:

Notice: Trying to get property of non-object in /home/kavwxoln/feelfreehypnosis.com/wp-includes/class-wp-customize-nav-menus.php on line 682

Fatal error: Uncaught exception 'Exception' with message 'Illegal widget 
setting ID: nav_menu_item[]' in /home/kavwxoln/feelfreehypnosis.com/wp- 
includes/customize/class-wp-customize-nav-menu-item-setting.php:171 Stack trace: #0 /home/kavwxoln/feelfreehypnosis.com/wp-includes/class-wp-customize-nav-menus.php(693): WP_Customize_Nav_Menu_Item_Setting->__construct(Object(WP_Customize_Manager), 'nav_menu_item[]', Array) #1 [internal function]: WP_Customize_Nav_Menus->customize_register(Object(WP_Customize_Manager)) #2 /home/kavwxoln/feelfreehypnosis.com/wp-includes/class-wp-hook.php(286): call_user_func_array(Array, Array) #3 /home/kavwxoln/feelfreehypnosis.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array) #4 /home/kavwxoln/feelfreehypnosis.com/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #5 /home/kavwxoln/feelfreehypnosis.com/wp-includes/class-wp-customize-manager.php(926): do_action('customize_regis...', Object(WP_Customize_Manager)) #6 [internal function]: WP_Customize_Manager->wp_loaded('' in /home/kavwxoln/feelfreehypnosis.com/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php on line 171

我在Google上搜索了thread,但是在应用那里提供的答案时

ALTER TABLE `wp_terms`
CHANGE COLUMN `term_id` `term_id` BIGINT(20) UNSIGNED NOT NULL 
AUTO_INCREMENT FIRST,
ADD PRIMARY KEY (`term_id`),
ADD INDEX `name` (`name`),
ADD INDEX `slug` (`slug`);

我从phpmyadmin得到了这个答案:

#1068 - Multiple primary key defined

所以我正在寻找asnwer如何解决这个问题。

1 个答案:

答案 0 :(得分:0)

这就是我的所作所为:

  1. 通过Phpmyadmin转到数据库,然后仅从 wp_terms 表进行备份!
  2. 转到SQL编辑器并粘贴此代码:

    CREATE TABLE wp_termsterm_id bigint(20)unsigned NOT NULL AUTO_INCREMENT, name varchar(200)NOT NULL DEFAULT'', slug varchar(200)NOT NULL DEFAULT'', term_group bigint(10)NOT NULL DEFAULT'0', PRIMARY KEY(term_id), 独特的钥匙slugslug), KEY namename) )ENGINE = MyISAM AUTO_INCREMENT = 603 DEFAULT CHARSET = utf8;

  3. 从.sql文件打开以前保存的备份,然后使用phpmyadmin通过SQL编辑器插入。

  4. 问题解决了!

    注意:只从备份中获取行,而不是整个数据库!