跳过导航

Open

Reported for: Advanced Custom Fields Multilingual 2.0.5

Topic Tags: Compatibility

Overview of the issue

In some situations, you may find the following fatal error when trying to translate variable products in WooCommerce Multilingual:

[07-Dec-2023 15:00:47 UTC] PHP Fatal error:  Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, string given in .../wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-editor-ui-product-job.php:610

Workaround

Please, make sure of having a full backup of your site before proceeding.

  • Open …/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-editor-ui-product-job.php file.
  • Look for line 602.
  • Replace:
    $custom_fields            = $this->get_custom_field_values( $this->product_id, $custom_field );
    
  • With:
    $custom_fields            = $this->get_custom_field_values( $element_id, $custom_field );
    

2 所有回复 给 “Advanced Custom Fields - PHP Fatal error: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array...”

  1. Thank you very much for showing how to solve the problem. It helped.

    I just have a question: won’t updating the WooCommerce Multilingual plugin remove this workaround and will it have to be implemented every time after the update?

    • Hello Miroslaw,
      This issue will be solved in a future release of WooCommerce Multilingual. However until it is confirmed, updating this plugin will remove the workaround and it will be needed to add it again.
      We will keep this link updated.
      Regards

留下回复

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

您可以使用这些标签:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>