error when adding or editing a product
-
Hi
So I have my own custom theme (fse), and it worked without issues with woocommerce. Suddenly i get this error when i go to add or edit a product:The bizzare thing is that when I replace my theme with twenty twenty two, the error doesn’t appear, so it must be something with my theme (I deactivated all other plugins except woocommerce). In my functions.php file I include a file with my woocommerce code, so i commented the include…..and the error persisted.
So any idea what can be wrong? What am I missing here?
-
Hi @derrida
Thank you for reaching out!
Could you please confirm if all of your plugins and the theme are updated to the latest version?
Also, in order for us to get a better understanding of your site setup, could you please share a copy of your website’s System Status Report?
You can get it by navigating to the
WooCommerce / Statussection of your site. Once there, click on theGet system reportbutton and then copy it by clicking on theCopy for supportbutton. Then paste it here in a comment.Thank you!
Hi
as i said it is my won custom FSE theme. i deactivated all other plugins.this is my status report:
### WordPress Environment ### WordPress address (URL): http://shtig2.local Site address (URL): http://shtig2.local WC Version: 6.5.1 REST API Version: ✔ 6.5.1 WC Blocks Version: ✔ 7.6.0 Action Scheduler Version: ✔ 3.4.0 Log Directory Writable: ✔ WP Version: 5.9.3 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ✔ Language: he_IL External object cache: – ### Server Environment ### Server Info: nginx/1.16.0 PHP Version: 7.4.1 PHP Post Max Size: 1,000 MB PHP Time Limit: 1200 PHP Max Input Vars: 4000 cURL Version: 7.67.0 OpenSSL/1.1.1d SUHOSIN Installed: – MySQL Version: 8.0.16 Max Upload Size: 300 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 6.5.1 WC Database Prefix: wp_ הגודל הכולל של בסיס הנתונים: 6.06MB גודל הנתונים של בסיס הנתונים: 4.57MB גודל האינדקס של בסיס הנתונים: 1.49MB wp_woocommerce_sessions: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_woocommerce_api_keys: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_woocommerce_attribute_taxonomies: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_woocommerce_downloadable_product_permissions: נתונים: 0.02MB + אינדקס: 0.06MB + מנוע InnoDB wp_woocommerce_order_items: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_woocommerce_order_itemmeta: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_woocommerce_tax_rates: נתונים: 0.02MB + אינדקס: 0.06MB + מנוע InnoDB wp_woocommerce_tax_rate_locations: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_woocommerce_shipping_zones: נתונים: 0.02MB + אינדקס: 0.00MB + מנוע InnoDB wp_woocommerce_shipping_zone_locations: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_woocommerce_shipping_zone_methods: נתונים: 0.02MB + אינדקס: 0.00MB + מנוע InnoDB wp_woocommerce_payment_tokens: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_woocommerce_payment_tokenmeta: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_woocommerce_log: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_actionscheduler_actions: נתונים: 0.02MB + אינדקס: 0.11MB + מנוע InnoDB wp_actionscheduler_claims: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_actionscheduler_groups: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_actionscheduler_logs: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_commentmeta: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_comments: נתונים: 0.02MB + אינדקס: 0.08MB + מנוע InnoDB wp_links: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_options: נתונים: 2.05MB + אינדקס: 0.06MB + מנוע InnoDB wp_postmeta: נתונים: 0.13MB + אינדקס: 0.06MB + מנוע InnoDB wp_posts: נתונים: 1.50MB + אינדקס: 0.06MB + מנוע InnoDB wp_term_relationships: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_term_taxonomy: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_termmeta: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_terms: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_usermeta: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_users: נתונים: 0.02MB + אינדקס: 0.05MB + מנוע InnoDB wp_wc_admin_note_actions: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_wc_admin_notes: נתונים: 0.05MB + אינדקס: 0.00MB + מנוע InnoDB wp_wc_category_lookup: נתונים: 0.02MB + אינדקס: 0.00MB + מנוע InnoDB wp_wc_customer_lookup: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_wc_download_log: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_wc_order_coupon_lookup: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_wc_order_product_lookup: נתונים: 0.02MB + אינדקס: 0.06MB + מנוע InnoDB wp_wc_order_stats: נתונים: 0.02MB + אינדקס: 0.05MB + מנוע InnoDB wp_wc_order_tax_lookup: נתונים: 0.02MB + אינדקס: 0.03MB + מנוע InnoDB wp_wc_product_attributes_lookup: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_wc_product_download_directories: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_wc_product_meta_lookup: נתונים: 0.02MB + אינדקס: 0.09MB + מנוע InnoDB wp_wc_rate_limits: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_wc_reserved_stock: נתונים: 0.02MB + אינדקס: 0.00MB + מנוע InnoDB wp_wc_tax_rate_classes: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB wp_wc_webhooks: נתונים: 0.02MB + אינדקס: 0.02MB + מנוע InnoDB ### Post Type Counts ### attachment: 24 oembed_cache: 1 page: 8 post: 5 product: 19 product_variation: 7 revision: 37 wp_global_styles: 1 wp_navigation: 1 wp_template: 4 wp_template_part: 1 ### Security ### Secure connection (HTTPS): ❌ החנות לא משתמשת בHTTPS. מידע נוסף על HTTPS ותעודות SSL. Hide errors from visitors: ✔ ### Active Plugins (2) ### WooCommerce Blocks: מאת חברת אוטומטיק – 7.6.0 ווקומרס: מאת חברת אוטומטיק – 6.5.1 ### Inactive Plugins (12) ### Cards Slider: מאת Ron Shtigliz – 0.1.0 Container With Dividers: מאת Ron Shtigliz – 0.1.0 Gutrs Add Margins: מאת Ron Shtigliz – 0.1.0 Gutrs Add Paddings: מאת Ron Shtigliz – 0.1.0 Gutrs Animations: מאת Ron Shtigliz – 0.1.0 Gutrs Copyrights: מאת Ron Shtigliz – 0.1.0 Gutrs Icon: מאת Ron Shtigliz – 0.1.0 Gutrs Make Grid: מאת Ron Shtigliz – 0.1.0 Gutrs Slider: מאת Ron Shtigliz – 0.1.0 Gutrs Social Share: מאת Ron Shtigliz – 0.1.0 Icon Dropdown: מאת Ron Shtigliz – 0.1.0 Position Z: מאת Ron Shtigliz – 0.1.0 ### Settings ### API Enabled: – Force SSL: – Currency: ILS (₪) Currency Position: right_space Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – Enforce Approved Product Download Directories: ✔ ### WC Pages ### בסיס חנות: #66 - /shop/ סל קניות: #67 - /cart/ תשלום: #68 - /checkout/ החשבון שלי: #69 - /my-account/ תנאי שימוש: ❌ דף לא מוגדר ### Theme ### Name: Gutrs Version: 1.0 Author URL: http://shtigliz.com/ Child Theme: ❌ – אם משנים את ווקומרס בערכת נושא אב שלא נבנתה באופן אישי מומלץ להשתמש בערכת עיצוב בת. אפשר לראות: כיצד ליצור ערכת עיצוב בת WooCommerce Support: ✔ ### Templates ### Overrides: – ### Action Scheduler ### הושלם: 44 Oldest: 2022-05-11 15:48:58 +0300 Newest: 2022-05-19 08:44:00 +0300 ממתין לאישור: 2 Oldest: 2022-05-19 08:44:03 +0300 Newest: 2022-05-20 08:44:00 +0300 ### Status report information ### Generated at: 2022-05-19 08:44:47 +03:00Hi @derrida !
Thank you for sharing that with us 🙂
Since the issue only appears with a custom theme please reach out to the theme developers as they are the best source of support in this case.
In case you have developed the theme on your own, please check out our developer docs here: https://woocommerce.com/developers/, or you can hire a developer on our customizations page here: https://woocommerce.com/customizations/
Thank you!
hi @rdeari
so after checking and testing a lot, the issue is not with my theme. you have an issue with templates, and with the in_array function. i have no idea why you bring post templates, and then you get NULL for the checking if the post-types is product. you need to change the if statement or whenever in your code you ask for the templates.to check it: use twenty twenty two theme, then add a new post template (call it what ever), then try to add or edit a procust. you will get that error.
i have tried writing manually a template and adding a post template in the editor itself: the same error.
you have issues there with the code: try var_dump and see that somehow you call the post template, and the post type is NULL.
Hello,
Thanks for writing back. I’ve had no luck reproducing the error you described, but I would ask that you report the bug directly to the WooCommerce developer team here: https://github.com/woocommerce/woocommerce/issues
I’ll go ahead and close this topic, as there’s nothing else we can do on the subject here in the forum.
Please open a new topic if you need assistance with a WooCommerce core functionality.
The topic ‘error when adding or editing a product’ is closed to new replies.