Overview of the Issue
When using certain themes, you can get the following fatal error that breaks the display of the page:
Fatal error: Uncaught exception ‘InvalidArgumentException’ with message ‘Argument ID must be numeric and greater than 0’
Workaround
This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.
The issue is caused by the themes in question because they are passing arguments with incorrect type (arrays instead of objects) to WordPress filters.
This issue will be resolved in the next release by enforcing the usage of correct type by the variables.
In the meantime, you can patch the code by manually adding the following line to the sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-render.php file, at line 127 (at the top of the function):
$args = (object) $args;
After the patch is applied, the code should look like this:
//...
public function wp_nav_menu_objects_filter( $items, $args ) {
$args = (object) $args;
$menu_id = isset( $args->menu->term_id ) ? $args->menu->term_id : null;
//...
Still Seeing This Issue?
If updating doesn’t fix it, ask a support question and we’ll look into it with you.
Ask a support question