Attributes > New Attribute Panel Loads Automatically On All Variable Products
-
I’m using WP 6.2.2 and WooCommerce 7.7.0.
I attempted to edit a variable product in order to add some attribute values, but found the New Attribute panel was already loaded, which disables the Save Attributes button.
I had to remove the New Attribute panel (by clicking Remove), then was able to save the edited attribute.
I discovered that any time I opened a variable product to edit and clicked the Attributes tab, the New Attribute panel was already loaded as if I had clicked the Custom Product Attribute Add button–I did not–and had to be removed before any edits could be made to an existing attribute.
Once I remove the New Attribute, I can click back to the General Tab and come back to Attributes, and the New Attribute panel remains gone, but if I click Update, the New Attribute panel is back when I re-visit the Attributes tab.
I checked some other WooCommerce sites, some on the same server, some on different servers. Besides the production and staging site, there is one other site on the same server that is affected, while others are not. One on another server behaves the same way.
Fortunately, my staging site has the same issue, so I did a conflict test by switching to the Storefront theme and disabling all plugins except for WooCommerce, but the problem persists.
I also went into WooCommerce > Status > Tools and ran:
- Clear transients
- Delete orphaned variations
- Regenerate product lookup tables
- Regenerate the product attributes lookup table (for a newly created test variable product which is also affected)
None of those made any difference. I still get a blank, New Attribute panel in every variable product I open for editing.
There are no JavaScript errors in the console, and no errors in my error logs.
Any ideas?
-
Hi @linux4me2
Thanks for reaching out!
I appreciate the detailed information you’ve provided about the issue you’re experiencing with the New Attribute panel in WooCommerce 7.7.0 on your WP 6.2.2 site. I understand that it can be frustrating when things don’t work as expected, and I’m here to help.
Based on your description, it seems like you have already tried several troubleshooting steps, such as switching to the Storefront theme, disabling plugins, and running various WooCommerce tools but still the issue persists.
This is indeed quite a strange behavior as I’m unable to replicate this issue on my personal site. This is what I’m seeing on my end when I add a new product or edit an existing product under the Attributes menu.
To better picture what you are referring to here, can you please share with us a clear screenshot of what you see on your end so that we could address you more effectively?
If you don’t already have a screenshot service installed, you can try https://snipboard.io. You can share the direct link to the image as a response to this topic.
Furthermore, for us to investigate your issue further, I’d like to understand your site properly. Please share your System Status Report that you can find via
WooCommerce > Status
. SelectGet system report
and thenCopy for support
. Once you’ve done that, you can paste it into your reply here.If you could also provide the fatal error logs (if any) under
WooCommerce > Status > Logs
.You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.
Thanks!
Hi @xue28,
WordPress lost my entire reply, so I’ll post it again and hope it isn’t duplicated.
This is a strange behavior, because it doesn’t happen on all the sites I have access to.
Here’s what I see with a new variable product:
Here is what I get when editing an existing product:
Here is the system report with all plugins but WooCommerce disabled and the Storefront theme active:
` ### WordPress Environment ### WordPress address (URL): https://test.thedomain.com Site address (URL): https://test.thedomain.com WC Version: 7.7.0 REST API Version: ? 7.7.0 WC Blocks Version: ? 10.0.4 Action Scheduler Version: ? 3.5.4 Log Directory Writable: ? WP Version: 6.2.2 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ? Language: en_US External object cache: – ### Server Environment ### Server Info: LiteSpeed PHP Version: 8.0.28 PHP Post Max Size: 128 MB PHP Time Limit: 30 PHP Max Input Vars: 3000 cURL Version: 7.61.1 OpenSSL/1.1.1k SUHOSIN Installed: – MySQL Version: 10.5.19-MariaDB-cll-lve Max Upload Size: 128 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 7.7.0 WC Database Prefix: wp_ Total Database Size: 45.66MB Database Data Size: 26.94MB Database Index Size: 18.72MB wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.13MB + Index: 0.09MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.11MB + Index: 0.16MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.08MB + Index: 0.06MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.13MB + Index: 0.09MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_litespeed_img_optming: Data: 0.61MB + Index: 0.83MB + Engine MyISAM wp_options: Data: 2.47MB + Index: 0.23MB + Engine InnoDB wp_postmeta: Data: 11.52MB + Index: 7.03MB + Engine InnoDB wp_posts: Data: 3.52MB + Index: 0.70MB + Engine InnoDB wp_relevanssi: Data: 6.52MB + Index: 7.55MB + Engine InnoDB wp_relevanssi_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_relevanssi_stopwords: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_termmeta: Data: 0.14MB + Index: 0.16MB + Engine InnoDB wp_terms: Data: 0.11MB + Index: 0.13MB + Engine InnoDB wp_term_relationships: Data: 0.22MB + Index: 0.13MB + Engine InnoDB wp_term_taxonomy: Data: 0.11MB + Index: 0.13MB + Engine InnoDB wp_tinvwl_analytics: Data: 0.08MB + Index: 0.05MB + Engine InnoDB wp_tinvwl_items: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_tinvwl_lists: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_usermeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wcpdf_packing_slip_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_notes: Data: 0.05MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.05MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_attributes_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.28MB + Index: 0.44MB + Engine InnoDB wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfls_role_counts: Data: 0.00MB + Index: 0.00MB + Engine MEMORY wp_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB ### Post Type Counts ### attachment: 1555 cfredux_contact_form: 4 mc4wp-form: 1 nav_menu_item: 151 page: 121 post: 9 product: 618 product_variation: 2140 revision: 221 shop_coupon: 23 shop_order: 6 shop_order_refund: 180 soliloquy: 1 wp_global_styles: 1 wp_navigation: 1 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (1) ### WooCommerce: by Automattic – 7.7.0 ### Inactive Plugins (10) ### Contact Form Redux: by linux4me2 – 1.3.4 MainWP Child: by MainWP – 4.4.1.1 Payment Plugins for Stripe WooCommerce: by Payment Plugins [email protected] – 3.3.41 PDF Invoices & Packing Slips for WooCommerce: by WP Overnight – 3.5.4 Relevanssi: by Mikko Saari – 4.20.0 Responsive WordPress Slider - Soliloquy Lite: by Soliloquy Team – 2.7.2 Simple Lightbox: by Archetyped – 2.9.3 TI WooCommerce Wishlist: by TemplateInvaders – 2.5.1 User Role Editor: by Vladimir Garagulya – 4.63.3 Wordfence Login Security: by Wordfence – 1.1.2 ### Settings ### API Enabled: – Force SSL: ? Currency: USD ($) Currency Position: left 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: – HPOS feature screen enabled: – HPOS feature enabled: – Order datastore: WC_Order_Data_Store_CPT HPOS data sync enabled: – ### WC Pages ### Shop base: #2799 - /shop/ Cart: #14 - /cart/ Checkout: #15 - /checkout/ My account: #16 - /my-account/ Terms and conditions: ? Page not set ### Theme ### Name: Storefront Version: 4.3.0 Author URL: https://woocommerce.com/ Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ? ### Templates ### Overrides: – ### Admin ### Enabled Features: activity-panels analytics coupons customer-effort-score-tracks import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing mobile-app-banner navigation onboarding onboarding-tasks remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page Disabled Features: product-block-editor minified-js new-product-management-experience product-variation-management settings Daily Cron: ? Next scheduled: 2023-05-25 16:53:14 -07:00 Options: ? Notes: 41 Onboarding: completed ### Action Scheduler ### Complete: 260 Oldest: 2023-04-24 11:23:12 -0700 Newest: 2023-05-25 09:47:07 -0700 Failed: 2 Oldest: 2023-04-26 07:30:38 -0700 Newest: 2023-05-25 09:49:58 -0700 Pending: 2 Oldest: 2023-05-26 07:07:45 -0700 Newest: 2023-05-26 07:07:45 -0700 ### Status report information ### Generated at: 2023-05-25 09:51:34 -07:00 `
There are no error logs.
Hello @linux4me2,
Thank you for the report!
I also wasn’t able to replicate the issue, have you tried clearing your browser’s cache?
It could be browser-related. :?)
Let us know how it goes!Hi @babylon1999
Thank you for trying.
Clearing my browser’s cache was one of the first things I did, though I didn’t mention it in my first post, as browser-caching can so often cause issues. I also tried two different browsers (Firefox and Chromium), but none of that resolves the issue.
Of note is that there is no server-caching, either.
Just in case, I downloaded all the /wp-content/plugins/woocommerce files from an unaffected site and an affected site and ran a comparison using diff, but there were not differences between the files of the two sites:
$ diff -q woocommerce-unaffected/ woocommerce-affected/ Common subdirectories: woocommerce-unaffected/assets and woocommerce-affected/assets Common subdirectories: woocommerce-unaffected/client and woocommerce-affected/client Common subdirectories: woocommerce-unaffected/i18n and woocommerce-affected/i18n Common subdirectories: woocommerce-unaffected/includes and woocommerce-affected/includes Common subdirectories: woocommerce-unaffected/lib and woocommerce-affected/lib Common subdirectories: woocommerce-unaffected/packages and woocommerce-affected/packages Common subdirectories: woocommerce-unaffected/sample-data and woocommerce-affected/sample-data Common subdirectories: woocommerce-unaffected/src and woocommerce-affected/src Common subdirectories: woocommerce-unaffected/templates and woocommerce-affected/templates Common subdirectories: woocommerce-unaffected/vendor and woocommerce-affected/vendor
I guess that means the issue is coming from something in the database?
I found the difference between affected sites and those that are not!
The unaffected sites have at least one global attribute. The affected sites have no global attributes, only product-specific attributes.
@babylon1999 and @xue28, perhaps you could not reproduce the issue because both your test sites have at least one global attribute?
I can prevent the extraneous New Attribute panel from loading by adding a global attribute. If I remove the global attribute, the extraneous New Attribute panel is back. I tested a few times, and the behavior is consistent.
I also found this code on line 60 of wp-content/plugins/woocommerce/assets/js/admin/meta-boxes-product.js:
$( function () { if ( ! woocommerce_admin_meta_boxes.has_local_attributes ) { $( 'button.add_attribute' ).trigger( 'click' ); } } );
If I comment out the line that triggers the click event for the Add Attribute button in that block of code, and set SCRIPT_DEBUG to true in wp-config.php so that the un-minified version of meta-boxes-product.js is loaded, it also prevents the issue with the extraneous Add Attribute panel from occurring.
That leads me to suspect that if there are no global attributes, WooCommerce is incorrectly setting the value of the woocommerce_admin_meta_boxes.has_local_attributes object so that the click event for the Add Attribute is triggered when it should not be.
Thank you so much for sharing these findings, @linux4me2!
As you mentioned, I can reproduce it now when removing all global attributes; however, it might not be a bug.
Nonetheless, I created a bug report about it here for the developers to review: https://github.com/woocommerce/woocommerce/issues/38547
I suggest you subscribe to it to receive updates. :?)
Thanks again for the feedback!
Cheers!Hi @babylon1999,
Thank you for submitting the bug report!
Judging by the code snippet I included above, I believe opening an empty New Attribute panel is a feature intended only for when there are no product-specific (local) attributes. In that case, it’s convenient to have the New Attribute panel open without the need of an extra button-click to add a new attribute.
However, if there are already local attributes, the panel shouldn’t open, because it requires the user to remove the New Attribute panel to edit existing local attributes. In that situation, I think it’s a bug.
However, if there are already local attributes, the panel shouldn’t open, because it requires the user to remove the New Attribute panel to edit existing local attributes. In that situation, I think it’s a bug.
You are probably right; I would also prefer to have it closed, to be honest. However, based on my test, I can easily edit the existing local attribute even when the panel is open.
Link to image: https://d.pr/i/7Va8BCI suggest you wait for the developer’s response on the matter.
Also, thank you so much for the feedback here! We appreciate your effort in improving WooCommerce. :?)
Cheers!Hi @babylon1999,
However, based on my test, I can easily edit the existing local attribute even when the panel is open.
I can edit existing local attributes too, I just can’t save the changes unless I delete the New Attribute panel because the Save Attributes button stays disabled as long as there is an uncompleted New Attribute panel there.
I will wait to see what the developers say as you recommend. I doubt that this is a big priority for them since there are easy workarounds (add a global attribute, remove the New Attribute panel to save edits), but I hope they fix it. : )
@linux4me2 Thanks for that! I’ve added more context in the Github issue that hopefully would provide more clarity on the issue.
https://github.com/woocommerce/woocommerce/issues/38547#issuecomment-1584572627
@druesome Very helpful! Thanks for doing that.
I just updated to WC 7.8.0, and this issue seems to be fixed, so I’m marking this topic “resolved.”
Thanks for the help!
I updated to woocommerce 8.2.0 today and face the same error.
As soon as I add an attribute to a product it automatically fills it with all known values. For some attributes this causes the site to break down because of the high number of values.
Me too. Fresh WP 6.3.2 + fresh WC 8.2.0
It also auto adds “used for variations” (or it’s translation from spanish) checkmark if product is variable
- The topic ‘Attributes > New Attribute Panel Loads Automatically On All Variable Products’ is closed to new replies.