- Status
- Resolved
- Type
- Bug
- Reported for
- WPML Multilingual CMS 4.6.3
- Resolved in
- WPML 4.6.5
- Topic tags
- Bug
Overview of the issue
We have identified an issue where WPML notices can sometimes result in fatal errors. This problem is caused by a corruption in the wpml_notices key within the database. You may encounter a similar error message as a result:
Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in ...\wp-content\plugins\sitepress-multilingual-cms\classes\notices\class-wpml-notices.php:373 Stack trace: #0 ...\wp-content\plugins\sitepress-multilingual-cms\classes\notices\class-wpml-notices.php(159): WPML_Notices->group_and_id_exist('taxonomy-term-h...', 'brand') #1 ...\wp-content\plugins\sitepress-multilingual-cms\classes\notices\class-wpml-notices.php(112): WPML_Notices->notice_exists(Object(WPML_Notice)) #2 ...\wp-content\plugins\sitepress-multilingual-cms\classes\taxonomy-term-translation\class-wpml-taxonomy-translation-help-notice.php(111): WPML_Notices->add_notice(Object(WPML_Notice)) #3 ...\wp-content\plugins\sitepress-multilingual-cms\classes\taxonomy-term-translation\class-wpml-taxonomy-translation-help-notice.php(70): WPML_Taxonomy_Translation_Help_Notice->add_term_help_notice_to_admin_notices() #4 ...\wp-includes\class-wp-hook.php(308): WPML_Taxonomy_Translation_Help_Notice->add_help_notice('') #5 ...\wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #6 ...\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #7 ...\wp-admin\admin.php(175): do_action('admin_init') #8 ...\wp-admin\edit-tags.php(10): require_once('...') #9 {main} thrown in ...\wp-content\plugins\sitepress-multilingual-cms\classes\notices\class-wpml-notices.php on line 373
Workaround
The current workaround for this issue is to remove the wpml_notices key from the options table.
- Be sure of having a full backup of your site before proceeding.
- Access to your database.
- Open wp_options table.
- Look for the wpml_notices key.
- Remove it.
It will regenerated automatically and the error should disappear.