Template duplication skips WooCommerce tables and never recreates them, so carts are lost on new sites
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 62/100
調査の方向性
Start in inc/duplication/data.php, where Data::is_runtime_table() lists the WooCommerce tables that are skipped during template duplication, and read the docblock that says they are regenerated. Reproduce by duplicating a WooCommerce template site and checking whether the woocommerce_sessions table exists on the new blog. Done means the tables exist on the destination and a cart survives a page load, and you should first settle which of the two fixes the issue proposes.
索引モデルが issue の本文から書いたものです。
説明
Version: Ultimate Multisite 2.17.2, WooCommerce, subdomain multisite
What happens:
Data::is_runtime_table() (inc/duplication/data.php) skips woocommerce_sessions, woocommerce_api_keys, woocommerce_downloadable_product_permissions and woocommerce_log when duplicating a template. The docblock says these tables “are regenerated on the destination site”, but nothing creates them. On the new site those four tables don’t exist at all.
Visible symptom: WooCommerce can’t save the session. A visitor adds a product and the mini-cart count updates from the AJAX response. On the next page load, /cart and /checkout are empty, and the Store API /wc/store/v1/cart returns no items even when the session cookie is sent. It happens in incognito and on any device. Nothing is logged on the front end.
Reproduce:
Duplicate a site that has WooCommerce active, using a template.
Check the DB for {prefix}{blog_id}_woocommerce_sessions. It’s missing.
Add a product to the cart, then request /cart with the same cookie. The cart is empty.
Suggested fix: skip the rows but keep the structure. For tables flagged as runtime-only, run CREATE TABLE IF NOT EXISTS LIKE instead of skipping them entirely. That keeps the intent (no copying of sessions, logs or queues) and avoids a missing-table problem for any plugin, not just WooCommerce. The same issue probably applies to other tables on that list, such as actionscheduler_, yoast_, redirection_* and litespeed_*, which some plugins expect to exist.
Alternative: after the data copy, switch to the new site and call WC_Install::create_tables() when WooCommerce is present.
Workaround we use: an mu-plugin that does the second option on mucd_after_copy_data.
- 主要言語
- PHP
- スター
- 218
- フォーク
- 87
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 85
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Ultimate-Multisite/ultimate-multisite のほかの issue
-
perf: lazy-load the top My Sites toolbar and defer initial site-list hydration対応中かも @superdav42 が 2 日前に担当しました。 オープンenhancement origin:interactive priority:medium status:in-review tier:standard
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Ultimate-Multisite/ultimate-multisite#2015 · コメント 6 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Secondary networks: sunrise queries unregistered scoped tables, and wu_{N}_* tables are never created対応中かも @superdav42 が 2 日前に担当しました。 オープンbug origin:interactive status:in-review
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Ultimate-Multisite/ultimate-multisite#2012 · コメント 13 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Secondary networks never get Ultimate Multisite tables created or upgraded対応中かも @superdav42 が 3 日前に担当しました。 オープンbug origin:interactive status:claimed
Ultimate-Multisite/ultimate-multisite#2009 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
auto-dispatch needs-investigation origin:worker security status:available tier:standard type:bug
難易度 3/5 半日 初心者へのやさしさ 30/100
Ultimate-Multisite/ultimate-multisite#1938 ·
メンテナーはふだん 1 日以内に返信
-
auto-dispatch needs-investigation origin:worker security status:available tier:standard type:bug
難易度 3/5 半日 初心者へのやさしさ 30/100
Ultimate-Multisite/ultimate-multisite#1930 ·
メンテナーはふだん 1 日以内に返信
Ultimate-Multisite/ultimate-multisite の issue をすべて見る
似ている issue
-
Awaiting Triage
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
reproduced
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
anomalyco/opencode#58664 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 87/100
WordPress/phpunit-test-runner#364 ·
メンテナーはふだん 4 日以内に返信
-
domain/framework Platform(Default) priority/high
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信