Hi @ndre ,
I’m sorry for the late reply, but I didn’t find the error_log, probably as it is on a shared server, php-error log wasn’t active and couldn’t be changed (and I didn’t have a local copy running yet :)). However, I found the option to set debugging, so I got the error on screen.
It looks like the error is caused by PolyLang, not your plugin.. or maybe a conflict between both..
Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in /var/www/vhosts/szilviart.be/httpdocs/wp-includes/pomo/translations.php:135
Stack trace: #0 /var/www/vhosts/szilviart.be/httpdocs/wp-includes/pomo/translations.php(154): Translations->translate_entry(Object(Translation_Entry)) #1 /var/www/vhosts/szilviart.be/httpdocs/wp-content/plugins/polylang/include/translate-option.php(382): Translations->translate(Array) #2 /var/www/vhosts/szilviart.be/httpdocs/wp-content/plugins/polylang/include/translate-option.php(279): PLL_Translate_Option->check_value_recursive(Array, NULL, Array, Object(PLL_MO)) #3 /var/www/vhosts/szilviart.be/httpdocs/wp-includes/class-wp-hook.php(324): PLL_Translate_Option->pre_update_option(NULL, Array, 'product_currenc…') #4 /var/www/vhosts/szilviart.be/httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters(NULL, Array) #5 /var/www/vhosts/szilviart.be/httpdocs/wp-includes/option.php(776): apply_filters('pre_update_opti…', NULL, Array, 'product_currenc…') #6 /var/www/vhosts/szilviart.be/httpdocs/wp-admin/options.php(340): update_option('product_currenc…', NULL) #7 {main} thrown in /var/www/vhosts/szilviart.be/httpdocs/wp-includes/pomo/translations.php on line 135
When I modified the mentioned line “pomo/translations.php:135
” from
return isset( $this->entries[ $key ] ) ? $this->entries[ $key ] : false;
to
return ( !is_array($key) && isset( $this->entries[ $key ] ) ? $this->entries[ $key ] : false);
The next error became
Fatal error: Uncaught TypeError: Illegal offset type in /var/www/vhosts/szilviart.be/httpdocs/wp-content/plugins/polylang/include/translate-option.php:385
From the block below, line 385 is the one which sets update_strings
} elseif ( $old_values !== $values ) {
if ( $mo->translate( $old_values ) === $values ) {
$values = $old_values; // Prevents updating the value to its translation.
} else {
$this->updated_strings[ $old_values ] = $values; // Stores the updated strings.
}
}
For this, I changed the ‘else’ from line 384 to
} elseif(!is_array($old_values)) {
Now the “save” works, but of course might have some unexpected behaviour .. and new crashes when an update comes on the translation.
BR,
Alain