当试图在我们的WordPress站点中编辑一个页面时,一些页面加载正常并且是可编辑的,但是一些页面在其中一个主题模块中显示错误。这是我们所看到的:

Fatal error: Uncaught exception 'Exception' with message 'Invalid product.' in /home/prikkabelled/public_html/wp-content/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php:133 Stack trace: #0 /home/prikkabelled/public_html/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(143): WC_Product_Data_Store_CPT->read(Object(WC_Product_Bundle)) #1 /home/prikkabelled/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php(126): WC_Data_Store->read(Object(WC_Product_Bundle)) #2 /home/prikkabelled/public_html/wp-content/plugins/woocommerce-product-bundles/includes/class-wc-product-bundle.php(117): WC_Product->__construct('7854') #3 /home/prikkabelled/public_html/wp-content/plugins/woocommerce-product-bundles/includes/admin/meta-boxes/class-wc-pb-meta-box-product-data.php(136): WC_Product_Bundle->__construct('7854') #4 [internal function]: WC_PB_Meta_Box_Product_Data::product_data_tabs(Array) #5 /home/prikkabelled/public_html/wp-includes/class-wp-hook.php(298): call in /home/prikkabelled/public_html/wp-content/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php on line 133我们已经将主题更新到最新版本(Electro)。我们还将Visual Composer plugin、WordPress和WooCommerce更新到了最新版本。
奇怪的是,只有一些页面在页面编辑模式下显示此错误,而在前端,页面看起来正常。此错误阻止我们以任何方式编辑页面。
知道原因是什么吗?
发布于 2017-04-29 10:14:39
错误的意思是它所说的:
Fatal error: Uncaught exception 'Exception' with message 'Invalid product.' in /home/prikkabelled/public_html/wp-content/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php:133
Stack trace:
#0 /home/prikkabelled/public_html/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(143): WC_Product_Data_Store_CPT->read(Object(WC_Product_Bundle))
#1 /home/prikkabelled/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php(126): WC_Data_Store->read(Object(WC_Product_Bundle))
#2 /home/prikkabelled/public_html/wp-content/plugins/woocommerce-product-bundles/includes/class-wc-product-bundle.php(117): WC_Product->__construct('7854')
#3 /home/prikkabelled/public_html/wp-content/plugins/woocommerce-product-bundles/includes/admin/meta-boxes/class-wc-pb-meta-box-product-data.php(136): WC_Product_Bundle->__construct('7854')
#4 [internal function]: WC_PB_Meta_Box_Product_Data::product_data_tabs(Array)
#5 /home/prikkabelled/public_html/wp-includes/class-wp-hook.php(298): call in /home/prikkabelled/public_html/wp-content/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php on line 133(为了可读性,我已经更正了格式。)
遵循该堆栈跟踪,您将发现抛出异常并显示消息"Invalid product“的代码。但在catch或set_exception_handler()中不会捕捉到异常,因此它会使程序停止。
因为您还没有发布Minimal, Complete, and Verifiable example.,所以不可能确切地说出发生这种情况的原因,但遵循堆栈跟踪应该会让它变得显而易见。
发布于 2017-04-29 10:24:00
当我们停用一个名为WooCommerce产品包的插件时,这个错误就消失了。堆栈跟踪中的错误#2是一个明显的泄漏。
#2 /home/prikkabelled/public_html/staging1/wp-content/plugins/woocommerce-product-bundles/includes/class-wc-product-bundle.php(117): WC_Product->__construct('5301')但是,我们仍然需要这个插件,所以我将这个问题报告给WooCommerce开发团队,因为错误是从他们的插件开始的。
https://stackoverflow.com/questions/43691119
复制相似问题