Skip to content

CSV Importer: import fails if Visibility in catalog or Tax status values are uppercase #33794

@jacoswan

Description

@jacoswan

Prerequisites

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

Describe the bug

When importing products via the CSV Importer, the import fails if either value in the Visibility in catalog or Tax status columns are uppercase. Those values are Visible and Taxable respectively.

If Visibility in catalog value is uppercase Visible, it results in this error:

Screenshot 2022-07-09 at 14 05 51

If Visibility in catalog is lowercase, but Tax status is Taxable, then this error occurs:

Screenshot 2022-07-09 at 14 08 10

Ensure all are lowercase, then the product imports successfully. Here's a CSV with the bearest of columns needed to recreate the issue. The values in this CSV are uppercase, so importing this product would fail:
uppercase-visible-taxable-import-will-fail.csv

Here's the same product, but with lowercase values. This CSV import will succeed.
lowercase-visible-taxable-import-will-succeed.csv

Expected behavior

I would expect the CVS Importer to be able to handle the values whether they're lowercase or capitlized. It seems often spreadsheet apps automatically captilize words when entered, so if a CSV is created or edited in a spreadsheet app, this is an easy error to make.

Actual behavior

When the values are Visible or Taxable respectively, the import fails.
When the values are visible and taxable respectively, the import succeeds.

Steps to reproduce

  1. Download the first file linked above
  2. Import it via Products > All Products > Import
  3. Notice how it fails.
  4. Download the second file linked above
  5. Repeat the import process
  6. Notice how it succeeds.

WordPress Environment

`

WordPress Environment

WordPress address (URL): https://woo.tst
Site address (URL): https://woo.tst
WC Version: 6.7.0
REST API Version: ✔ 6.7.0
WC Blocks Version: ✔ 7.8.3
Action Scheduler Version: ✔ 3.4.0
Log Directory Writable: ✔
WP Version: 6.0
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_US
External object cache: –

Server Environment

Server Info: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/8.1.5
PHP Version: 8.1.5
PHP Post Max Size: 500 MB
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 7.83.0
(SecureTransport) OpenSSL/1.1.1o

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

Database

WC Database Version: 6.7.0
WC Database Prefix: wp_
Total Database Size: 40.19MB
Database Data Size: 24.63MB
Database Index Size: 15.56MB
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.19MB + Index: 0.08MB + Engine InnoDB
wp_woocommerce_order_itemmeta: Data: 1.52MB + Index: 2.00MB + Engine InnoDB
wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.03MB + 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: 1.02MB + Index: 1.00MB + 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: 1.02MB + Index: 0.50MB + Engine InnoDB
wp_afwc_campaigns: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_afwc_commission_plans: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_afwc_hits: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_afwc_payouts: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_afwc_payout_orders: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_afwc_referrals: Data: 0.02MB + Index: 0.08MB + Engine InnoDB
wp_automatewoo_abandoned_carts: Data: 0.02MB + Index: 0.08MB + Engine InnoDB
wp_automatewoo_customers: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_automatewoo_customer_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_automatewoo_events: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_automatewoo_guests: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_automatewoo_guest_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_automatewoo_logs: Data: 0.05MB + Index: 0.05MB + Engine InnoDB
wp_automatewoo_log_meta: Data: 0.16MB + Index: 0.14MB + Engine InnoDB
wp_automatewoo_queue: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_automatewoo_queue_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_automatewoo_referrals: Data: 0.02MB + Index: 0.08MB + Engine InnoDB
wp_automatewoo_referral_advocate_keys: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_automatewoo_referral_invites: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_comments: Data: 0.36MB + Index: 0.44MB + Engine InnoDB
wp_followup_coupons: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_followup_coupon_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_followup_customers: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_followup_customer_carts: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_followup_customer_notes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_followup_customer_orders: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_followup_email_excludes: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_followup_email_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_followup_email_orders: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_followup_email_tracking: Data: 0.02MB + Index: 0.08MB + Engine InnoDB
wp_followup_followup_history: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_followup_order_categories: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_followup_order_items: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_followup_subscribers: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_followup_subscribers_to_lists: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_followup_subscriber_lists: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_gf_draft_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_gf_entry: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_gf_entry_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_gf_entry_notes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_gf_form: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_gf_form_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_gf_form_revisions: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_gf_form_view: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_gf_rest_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_gla_budget_recommendations: Data: 0.22MB + Index: 0.14MB + Engine InnoDB
wp_gla_merchant_issues: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_gla_shipping_rates: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_gla_shipping_times: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_mailchimp_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_options: Data: 6.03MB + Index: 0.19MB + Engine InnoDB
wp_pmxe_exports: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_pmxe_google_cats: Data: 0.39MB + Index: 0.00MB + Engine InnoDB
wp_pmxe_posts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_pmxe_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_postmeta: Data: 4.47MB + Index: 5.72MB + Engine InnoDB
wp_posts: Data: 1.48MB + Index: 0.33MB + Engine InnoDB
wp_snippets: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_spin_wheel_logs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_term_relationships: Data: 0.11MB + Index: 0.05MB + Engine InnoDB
wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_usermeta: Data: 0.48MB + Index: 0.50MB + Engine InnoDB
wp_users: Data: 0.05MB + Index: 0.05MB + Engine InnoDB
wp_wcpv_commissions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wcpv_per_product_shipping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wcrp_rental_products_rentals: 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_bookings_availability: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_bookings_availabilitymeta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_booking_relationships: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_customer_lookup: Data: 0.05MB + Index: 0.03MB + Engine InnoDB
wp_wc_deposits_payment_plans: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_deposits_payment_plans_schedule: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_bundle_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_wc_order_composite_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_product_lookup: Data: 0.33MB + Index: 0.36MB + Engine InnoDB
wp_wc_order_stats: Data: 0.08MB + 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.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_product_meta_lookup: Data: 0.11MB + Index: 0.16MB + 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.03MB + Engine InnoDB
wp_woocommerce_bis_activity: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_woocommerce_bis_notifications: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_woocommerce_bis_notificationsmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_bundled_itemmeta: Data: 0.16MB + Index: 0.20MB + Engine InnoDB
wp_woocommerce_bundled_items: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_exported_csv_items: Data: 4.02MB + Index: 0.13MB + Engine InnoDB
wp_woocommerce_mywhishlist: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_per_product_shipping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_prl_deploymentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_prl_deployments: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_prl_frequencies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_prl_tracking_clicks: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_woocommerce_prl_tracking_conversions: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_woocommerce_prl_tracking_views: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_table_rates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_square_customers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wp_phpmyadmin_extension__errors_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_yoast_indexable: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_yoast_seo_links: Data: 0.02MB + Index: 0.03MB + Engine InnoDB

Post Type Counts

af_disc_p_rules: 1
attachment: 138
aw_workflow: 24
bookable_person: 16
bookable_resource: 3
custom_css: 2
customize_changeset: 8
event_ticket: 14
follow_up_email: 1
nav_menu_item: 12
odr_order_bump: 1
order_shipment: 10
page: 30
post: 8
prl_engine: 1
product: 208
product_variation: 467
revision: 108
shop_bogof_rule: 2
shop_coupon: 1
shop_order: 580
shop_order_refund: 2
shop_subscription: 47
wbcr-snippets: 10
wc_booking: 26
wcpf_item: 7
wcpf_project: 1
wp_global_styles: 6
ww_stats: 3

Security

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

Active Plugins (3)

WooCommerce Beta Tester: by WooCommerce – 2.0.5
WooCommerce Stripe Gateway: by WooCommerce – 6.4.3
WooCommerce: by Automattic – 6.7.0-rc.1

Inactive Plugins (121)

...

Settings

API Enabled: –
Force SSL: –
Currency: USD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: accommodation-booking (accommodation-booking)
booking (booking)
bundle (bundle)
composite (composite)
external (external)
grouped (grouped)
photography (photography)
simple (simple)
subscription (subscription)
variable (variable)
variable subscription (variable-subscription)

Taxonomies: Product Visibility: exclude_from_catalog (exclude_from_catalog)
exclude_from_search (exclude_from_search)
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

Shop base: #6 - /shop/
Cart: #7 - /cart/
Checkout: #8 - /checkout/
My account: #9 - /my-account/
Terms and conditions: ❌ Page not set

Theme

Name: Storefront
Version: 4.1.1
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
experimental-products-task
experimental-import-products-task
experimental-fashion-sample-products
experimental-product-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
wc-pay-promotion
wc-pay-welcome-page
wc-pay-subscriptions-page

Disabled Features: minified-js
settings

Daily Cron: ✔ Next scheduled: 2022-07-10 12:37:57 +01:00
Options: ✔
Notes: 48
Onboarding: completed

Action Scheduler

Complete: 5,245
Oldest: 2022-06-24 10:24:32 +0100
Newest: 2022-07-09 14:12:22 +0100

Pending: 7
Oldest: 2022-07-10 10:15:15 +0100
Newest: 2022-07-20 12:20:28 +0100

Status report information

Generated at: 2022-07-09 14:16:15 +01:00
`

Isolating the problem

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThe issue is a confirmed bug.EnhancementThe issue is a request for an enhancement.Import/ExportIssues related to CSV import and export.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions