如何解决WooCommerce中的PHP断言失败错误?

时间:2013-12-24 14:39:25

标签: php wordpress-plugin woocommerce assert assertion

对于我托管的网站,我在Apache error_log中遇到以下错误:

  

PHP警告:assert()[function.assert]:第259行<> /wp-content/plugins/woocommerce-cart-reports/models/AV8_Cart_Receipt.php中的断言失败

该网站正在使用WooCommerce 2.0.14运行WordPress 3.6.1。该错误是参考Cart Reports插件,我正在运行1.0.2版本。

以下是来自... / plugins / woocommerce-cart-reports / models / AV8_Cart_Receipt.php的第259行

assert($this->post_id >0); //Make sure we're working with a valid post id.

以下是上下文的整个功能:

 public function update_receipt() {
    assert($this->sid != '');
            global $wpdb;
            global $offset;
            assert($offset != '' && is_numeric($offset));

            assert($this->post_id >0); //Make sure we're working with a valid post id.
            update_post_meta($this->post_id, 'av8_cartitems', $this->add_titles_to_cart_items($this->products));
            $post_updated = array(
               'ID' => $this->post_id,
               'post_title'=>$this->post_title,
               'post_author'=>$this->post_author,
               'post_date' => $this->post_date,
               'post_type' => 'carts'

            );

            wp_update_post($post_updated);
            update_post_meta($this->post_id, "av8_last_updated", gmmktime());
    }

我应该如何进行故障排除和/或解决此错误?

0 个答案:

没有答案