Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick edit attributes dont update if attribute slug is in Greek #31037

Closed
alexakis13 opened this issue Oct 27, 2021 · 10 comments
Closed

Quick edit attributes dont update if attribute slug is in Greek #31037

alexakis13 opened this issue Oct 27, 2021 · 10 comments
Labels
focus: product Issues related to product or product page. type: bug The issue is a confirmed bug.

Comments

@alexakis13
Copy link

Hello,

I have the same problem with 2 WooCommerce installations.

Prerequisites (mark completed items with an [x]):

  • [ x ] I have carried out troubleshooting steps and I believe I have found a bug.
  • [ x ] I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug
If I create an attribute and the slug is in Greek language, when I want to quick edit an attribute term I m getting 0 error like the screenshot bellow. If I rename the slug of the attribute I am able to quick edit the term again.

The starting 3 images are showing the error.
The next show that the change after rename the greek slug works.

Steps to reproduce the bug (We need to be able to reproduce the bug in order to fix it.)
Steps to reproduce the bug:

  1. Go to Products->Attributes and create an attribute called 'Χρώμα' and the slug 'χρώμα'.
  2. Create a term with the name and slug 'Άσπρο'.
  3. Then try to rename the term from 'Άσπρο' to 'Μαύρο'.
  4. You may see an 0 error notice.
  5. If you edit the Attribute slug from 'χρώμα' to 'chroma' and then you quick edit the term all works fine. If you just Edit and not quick edit it works both ways.

Screenshots

image
image
image
image
image

If applicable, add screenshots to help explain your problem.

Isolating the problem (mark completed items with an [x]):

  • [ x ] I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • [ x ] This bug happens with a default WordPress theme active, or Storefront.
  • [ x ] I can reproduce this bug consistently using the steps above.

WordPress Environment

` ### WordPress Environment ###

WordPress address (URL): https://logistics.casadino.gr
Site address (URL): https://logistics.casadino.gr
WC Version: 5.8.0
REST API Version: ✔ 5.8.0
WC Blocks Version: ✔ 5.9.1
Action Scheduler Version: ✔ 3.3.0
WC Admin Version: ✔ 2.7.2
Log Directory Writable: ✔
WP Version: 5.8.1
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: ✔
WP Cron: ✔
Language: el
External object cache: –

Server Environment

Server Info: Apache
PHP Version: 7.3.31
PHP Post Max Size: 8 MB
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 7.29.0
NSS/3.36

SUHOSIN Installed: –
MySQL Version: 5.5.68-MariaDB
Max Upload Size: 2 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 5.6.0
WC Database Prefix: wplg_
Συνολικό μέγεθος βάσης δεδομένων: 41.74MB
Μέγεθος βάσης δεδομένων: 33.64MB
Μέγεθος ευρετηρίου βάσης δεδομένων: 8.10MB
wplg_woocommerce_sessions: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_woocommerce_api_keys: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_woocommerce_attribute_taxonomies: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_woocommerce_downloadable_product_permissions: Δεδομένα: 0.02MB + Ευρετήρια: 0.06MB + Μηχανή InnoDB.
wplg_woocommerce_order_items: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_woocommerce_order_itemmeta: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_woocommerce_tax_rates: Δεδομένα: 0.02MB + Ευρετήρια: 0.06MB + Μηχανή InnoDB.
wplg_woocommerce_tax_rate_locations: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_woocommerce_shipping_zones: Δεδομένα: 0.02MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_woocommerce_shipping_zone_locations: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_woocommerce_shipping_zone_methods: Δεδομένα: 0.02MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_woocommerce_payment_tokens: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_woocommerce_payment_tokenmeta: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_woocommerce_log: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_actionscheduler_actions: Δεδομένα: 0.09MB + Ευρετήρια: 0.13MB + Μηχανή InnoDB.
wplg_actionscheduler_claims: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_actionscheduler_groups: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_actionscheduler_logs: Δεδομένα: 0.09MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_commentmeta: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_comments: Δεδομένα: 0.02MB + Ευρετήρια: 0.09MB + Μηχανή InnoDB.
wplg_e_submissions: Δεδομένα: 0.02MB + Ευρετήρια: 0.27MB + Μηχανή InnoDB.
wplg_e_submissions_actions_log: Δεδομένα: 0.02MB + Ευρετήρια: 0.11MB + Μηχανή InnoDB.
wplg_e_submissions_values: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_links: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_login_redirects: Δεδομένα: 0.02MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_lws_wr_achieved_log: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_lws_wr_historic: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_options: Δεδομένα: 4.03MB + Ευρετήρια: 0.09MB + Μηχανή InnoDB.
wplg_pmxi_files: Δεδομένα: 0.02MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_pmxi_hash: Δεδομένα: 0.02MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_pmxi_history: Δεδομένα: 0.02MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_pmxi_images: Δεδομένα: 0.42MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_pmxi_imports: Δεδομένα: 0.05MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_pmxi_posts: Δεδομένα: 0.14MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_pmxi_templates: Δεδομένα: 0.02MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_postmeta: Δεδομένα: 25.28MB + Ευρετήρια: 5.11MB + Μηχανή InnoDB.
wplg_posts: Δεδομένα: 2.17MB + Ευρετήρια: 0.70MB + Μηχανή InnoDB.
wplg_sm_advanced_search_temp: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_termmeta: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_terms: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_term_relationships: Δεδομένα: 0.14MB + Ευρετήρια: 0.09MB + Μηχανή InnoDB.
wplg_term_taxonomy: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_usermeta: Δεδομένα: 0.05MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_users: Δεδομένα: 0.02MB + Ευρετήρια: 0.05MB + Μηχανή InnoDB.
wplg_wc_admin_notes: Δεδομένα: 0.05MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_wc_admin_note_actions: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_wc_category_lookup: Δεδομένα: 0.02MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_wc_customer_lookup: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_wc_download_log: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_wc_order_coupon_lookup: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_wc_order_product_lookup: Δεδομένα: 0.02MB + Ευρετήρια: 0.06MB + Μηχανή InnoDB.
wplg_wc_order_stats: Δεδομένα: 0.02MB + Ευρετήρια: 0.05MB + Μηχανή InnoDB.
wplg_wc_order_tax_lookup: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.
wplg_wc_product_meta_lookup: Δεδομένα: 0.17MB + Ευρετήρια: 0.31MB + Μηχανή InnoDB.
wplg_wc_reserved_stock: Δεδομένα: 0.02MB + Ευρετήρια: 0.00MB + Μηχανή InnoDB.
wplg_wc_tax_rate_classes: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_wc_webhooks: Δεδομένα: 0.02MB + Ευρετήρια: 0.02MB + Μηχανή InnoDB.
wplg_wdp_orders: Δεδομένα: 0.02MB + Ευρετήρια: 0.05MB + Μηχανή InnoDB.
wplg_wdp_order_items: Δεδομένα: 0.02MB + Ευρετήρια: 0.06MB + Μηχανή InnoDB.
wplg_wdp_rules: Δεδομένα: 0.02MB + Ευρετήρια: 0.03MB + Μηχανή InnoDB.

Post Type Counts

attachment: 1818
condition_group: 1
custom_css: 1
elementor_library: 13
envato_tk_import: 1
lws-wre-event: 4
lws-wre-pool: 1
nav_menu_item: 27
page: 9
post: 3
product: 1167
product_variation: 255
restriction: 1
revision: 415
shop_coupon: 1

Security

Secure connection (HTTPS): ✔
Hide errors from visitors: ✔

Active Plugins (17)

Query Monitor: από τον/την John Blackbourn – 3.7.1
Ocean Extra: από τον/την OceanWP – 1.8.3
Advanced Dynamic Pricing for WooCommerce: από τον/την AlgolPlus – 3.3.1
Autoptimize: από τον/την Frank Goossens (futtta) – 2.9.2
CB Change Mail Sender: από τον/την Md Abul Bashar – 1.2.2
DethemeKit for Elementor: από τον/την deTheme – 1.5.7.3
Elementor Pro: από τον/την Elementor.com – 3.4.2
Elementor: από τον/την Elementor.com – 3.4.6
Envato Elements: από τον/την Envato – 2.0.11
LoginWP (Formerly Peter's Login Redirect): από τον/την LoginWP Team – 3.0.0.4
Smart Manager For WooCommerce – Stock Management, Bulk Edit & more...: από τον/την StoreApps – 5.29.0
User Role Editor: από τον/την Vladimir Garagulya – 4.60.2
Visibility Logic for Elementor: από τον/την StaxWP – 2.1.7
Woo Products Widgets For Elementor: από τον/την Themelocation – 1.0.5
WooCommerce: από τον/την Automattic – 5.8.0
MyRewards: από τον/την Long Watch Studio – 4.6.1
WP Fastest Cache: από τον/την Emre Vona – 0.9.5

Inactive Plugins (2)

WP All Import: από τον/την Soflyy – 3.6.2
WP All Import - WooCommerce Add-On: από τον/την Soflyy – 1.5.0

Dropin Plugins (1)

db.php: Query Monitor Database Class

Settings

API Enabled: –
Force SSL: –
Currency: EUR (€)
Currency Position: right
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: –

WC Pages

Βάση καταστήματος: #15 - /shop/
Καλάθι: #16 - /cart/
Ταμείο: #17 - /checkout/
Ο λογαριασμός μου: #18 - /my-account/
Όροι και Προϋποθέσεις: ❌ Η σελίδα δεν ορίστηκε

Theme

Name: OceanWP
Version: 3.0.7
Author URL: https://oceanwp.org/about-me/
Child Theme: ❌ – Αν κάνετε μετατροπή του WooCommerce πάνω σε ένα γονικό θέμα που δεν δημιουργήσατε εσείς προσωπικά
τότε σας προτείνουμε να χρησιμοποιήσετε ένα θέμα απόγονο. Δείτε: Πως να δημιουργήσετε ένα θέμα απόγονο

WooCommerce Support: ✔

Templates

Overrides: oceanwp/woocommerce/cart/mini-cart.php
oceanwp/woocommerce/content-single-product.php
oceanwp/woocommerce/loop/loop-start.php
oceanwp/woocommerce/single-product/title.php

Action Scheduler

Ολοκληρωμένη: 198
Oldest: 2021-10-06 12:46:46 +0000
Newest: 2021-10-27 09:21:49 +0000

Status report information

Generated at: 2021-10-27 12:49:33 +03:00
`

@rodelgc
Copy link
Contributor

rodelgc commented Oct 29, 2021

Hi @alexakis13,

Thank you for taking the time to report this bug, we really appreciate your help. I can reproduce it on my end using WC 5.8 and the default theme Twenty Twenty-One.

I was able to get the "0" error after putting in "Μαύρο" as the new term name and hitting "Update". However, I didn't see any console errors:
Screen Shot 2021-10-29 at 1 32 23 PM

Priority of this issue will be assigned shortly after we'd go through a round of prioritization. Please note it may take a couple of days.

@rodelgc rodelgc added focus: product Issues related to product or product page. type: bug The issue is a confirmed bug. labels Oct 29, 2021
@alexakis13
Copy link
Author

Yeah I don't either get any console error.. It works correct when you try to edit it through full edit.. so I guess the error maybe is something with the call to the db for the update with none Latin characters on slug..

@PanosSynetos
Copy link
Contributor

Hey @alexakis13 - Thanks for reporting this issue.

@woocommerce/proton I'm an engineer of the @woocommerce/somewherewarm team and I'd like to contribute to WooCommerce, whenever possible (we have a "cooldown" day after every sprint)

I had a look at the issue and I've made a preliminary investigation. I'd love to help out here with a fix.

  • Do you want me to share my findings before I start and discuss them with someone?
  • Is there anything I need to know before I fire up a PR?

Thanks and have a good one

@alexakis13
Copy link
Author

Hello @PanosSynetos,

Did you manage to reproduce the error? Do you need any extra details?

If there is anything I can help you with feel free to ask me!

@PanosSynetos
Copy link
Contributor

I managed to reproduce the error @alexakis13 - I'll ping you if I need any additional info. Καλό απόγευμα!

@alexakis13
Copy link
Author

OK @PanosSynetos Καλό απόγευμα!

@PanosSynetos
Copy link
Contributor

Hey @woocommerce/proton - I did some research on the issue, and I believe this is not related to WooCommece - It seems it's related to WordPress

When WooCommerce creates an attribute, behind the scenes it creates a new taxonomy. If the taxonomy's slug is χρώμα it creates a taxonomy pa_χρώμα.

When the native WP quick edit actions are used, behind the scenes it calls wp_ajax_inline_save_tax()

https://github.com/WordPress/wordpress-develop/blob/5.8.1/src/wp-admin/includes/ajax-actions.php#L2097-L2150

The very first thing this function does is

	$taxonomy = sanitize_key( $_POST['taxonomy'] );
	$tax      = get_taxonomy( $taxonomy );
	
	if ( ! $tax ) {
		wp_die( 0 );
	}	
  • sanitize_key strips out the Greek characters leaving pa_
  • get_taxonomy tries to get a taxonomy called pa_ , it doesn't exist and we get a 0 error

To take it a step further, I created a new taxonomy for posts , using Greek characters wp_ελληνικό_tax and there is the same issue.

function sw_custom_taxonomy() {

	$labels = array(
		'name'                       => _x( 'Ελληνικά Taxonomies', 'Taxonomy General Name', 'text_domain' ),
		'singular_name'              => _x( 'Ελληνικό Taxonomy', 'Taxonomy Singular Name', 'text_domain' ),
		'menu_name'                  => __( 'Ελληνικό Taxonomy', 'text_domain' ),
		'all_items'                  => __( 'All Items', 'text_domain' ),
		'parent_item'                => __( 'Parent Item', 'text_domain' ),
		'parent_item_colon'          => __( 'Parent Item:', 'text_domain' ),
		'new_item_name'              => __( 'New Item Name', 'text_domain' ),
		'add_new_item'               => __( 'Add New Item', 'text_domain' ),
		'edit_item'                  => __( 'Edit Item', 'text_domain' ),
		'update_item'                => __( 'Update Item', 'text_domain' ),
		'view_item'                  => __( 'View Item', 'text_domain' ),
		'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),
		'add_or_remove_items'        => __( 'Add or remove items', 'text_domain' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'text_domain' ),
		'popular_items'              => __( 'Popular Items', 'text_domain' ),
		'search_items'               => __( 'Search Items', 'text_domain' ),
		'not_found'                  => __( 'Not Found', 'text_domain' ),
		'no_terms'                   => __( 'No items', 'text_domain' ),
		'items_list'                 => __( 'Items list', 'text_domain' ),
		'items_list_navigation'      => __( 'Items list navigation', 'text_domain' ),
	);
	$args   = array(
		'labels'            => $labels,
		'hierarchical'      => false,
		'public'            => true,
		'show_ui'           => true,
		'show_admin_column' => true,
		'show_in_nav_menus' => true,
		'show_tagcloud'     => true,
	);
	register_taxonomy( 'wp_ελληνικό_tax', array( 'post' ), $args );

}

add_action( 'init', 'sw_custom_taxonomy', 0 );

image

I'd suggest that I open an issue in WP Core and we close this one, as it's not really related to WooCommerce.

Have a good one

@alexakis13
Copy link
Author

Hello, @PanosSynetos. Ok, I understand whats the problem. Yeah go ahead and open the issue! I learn something new for WP today! Thank you!

@peterfabian
Copy link
Contributor

Hey @PanosSynetos ! Great investigation, thanks! Closing this issue. Please comment with a link to the WP issue once you get around to creating it, thank you!

@PanosSynetos
Copy link
Contributor

Thanks a lot @peterfabian for your kind words :)

I just created the ticket, let's see https://core.trac.wordpress.org/ticket/54521

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: product Issues related to product or product page. type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

4 participants