Allow modules to choose which product element a sync updates
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with Products::createOrUpdateProduct() and the EVENT_BEFORE_SYNCHRONIZE_PRODUCT handler flow described in the issue. Trace where the product element is selected and how event handlers can affect it; the issue proposes two possible extension points but does not settle which one to use. Done means a module can select the existing product to update during sync, preventing duplicates after a database refresh.
索引モデルが issue の本文から書いたものです。
説明
We'd like to connect our test/acceptance Craft environments to our staging Shopify store, while production Craft stays on the production store. We run into duplicates, though. The non-production databases are frequently refreshed from production, so their products carry production GIDs. Products::createOrUpdateProduct() matches only by GID, so when the staging store syncs, every product is created a second time, next to the one that entries and relations point to.
In our case the handles are the same in both stores, so we match by handle instead. Today the only way to do that is to patch createOrUpdateProduct(). EVENT_BEFORE_SYNCHRONIZE_PRODUCT fires after the element has been picked, and the method keeps using its local variable, so a handler can't swap in a different element.
Handle matching might not belong in the plugin itself, as it's a niche case and handles are only unique within a store. A small extension point would let us move it into a module instead. For example:
- Use
$event->elementafterEVENT_BEFORE_SYNCHRONIZE_PRODUCT, so handlers can replace it. - Or add an event before the lookup that lets a handler return the element to update.
We also considered a one-off "relink by handle" command to run after each database copy. Given how often we refresh, we'd rather the sync just handles it.
Does that make sense, or is there a better way to handle this setup?
- 主要言語
- PHP
- スター
- 56
- フォーク
- 31
- 平均マージ
- 15時間 41分
- マージ済み PR(30日)
- 23
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
craftcms/shopify のほかの issue
-
Blitz cache not busted after updating variant in Shopify再び着手できるかも @nfourtythree が 285 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug Plugins Plugins → Shopify repo:shopify
craftcms/shopify#199 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
bug Plugins Plugins → Shopify repo:shopify
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
craftcms/shopify#193 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Migration failing when updating from 5.4.1 to 6.1.1 - Syntax error or access violation再び着手できるかも @nfourtythree が 359 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug Plugins Plugins → Shopify repo:shopify
craftcms/shopify#190 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Way to only sync products from online store channel?再び着手できるかも @nfourtythree が 456 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンrepo:shopify
craftcms/shopify#173 · コメント 6 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Plugins -> Shopify repo:shopify
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
craftcms/shopify#164 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
craftcms/shopify の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
Automattic/static-site-importer#3462 ·
メンテナーはふだん 1 日以内に返信
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpオープンenhancement feature: settings good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
nextcloud/integration_openai#480 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
roundcube/roundcubemail#10468 ·
メンテナーはふだん 1 日以内に返信