Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Template duplication skips WooCommerce tables and never recreates them, so carts are lost on new sites

オープン
#1,952 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php, sql
領域
backend, database

調査の方向性

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 の本文から書いたものです。

説明

needs-maintainer-review review:approve triage-failed

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Ultimate-Multisite/ultimate-multisite のほかの issue

Ultimate-Multisite/ultimate-multisite の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。