Treat platform express-checkout buttons in a bound add-to-cart form as an evidenced removal, not content loss

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

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

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

評価

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

調査の方向性

Start by reading the #6492 changes and the existing accepted-removal path in SourceContentConservationReporter, then trace how commerce_add_to_cart_form is bound. Add or update fixtures for the nested Shopify payment widget and for the same widget outside a bound form. Done means the bound case emits one info removal record and no html_content_dropped finding, while the unbound case still reports content loss and the #6492 cases pass.

索引モデルが issue の本文から書いたものです。

説明

Summary

Since #6492, source text dropped before emitted blocks is reported as html_content_dropped and counts toward content_loss_count. On commerce storefronts, one drop recurs on every product page: the platform's dynamic-checkout / express-payment button. Conversion drops it on purpose, because the target store provides its own checkout. With no evidence attached, though, it counts as content loss and fails the import gate.

Evidence (real Shopify storefront, Dawn-family theme)

On an otherwise intact product page, #6492 reports one finding. The selector is … > product-form > form > div, with lost run ["Comprar ahora"] ("Buy it now"). The source:

<div class="product-form__buttons">
  <button type="submit" name="add">Add to cart</button>
  <div data-shopify="payment-button" class="shopify-payment-button">
    <shopify-accelerated-checkout …>
      <shopify-buy-it-now-button access-token="…" page-type="product" slot="button">
        <button type="button" class="shopify-payment-button__button shopify-payment-button__button--unbranded">Buy it now</button>
      </shopify-buy-it-now-button>
    </shopify-accelerated-checkout>
  </div>
</div>

The add-to-cart form itself converts and binds (commerce_add_to_cart_form). Only the platform payment widget is gone.

Proposal

When the add-to-cart form binds, treat a platform express-checkout widget nested in it as an evidenced removal, not silent loss:

  • Recognise it from structural or platform evidence: a known payment custom element (shopify-buy-it-now-button, shopify-accelerated-checkout, or the data-shopify="payment-button" host), or a non-submit type="button" sibling of the bound submit inside a payment-button host. Don't match on the button's text.
  • Emit an info-level commerce_platform_checkout_removed record (selector, platform, lost text) through the existing accepted-removal path in SourceContentConservationReporter.
  • It must not count toward content_loss_count.
  • If the enclosing form does not bind, keep reporting the drop as content loss.

Acceptance

  • A neutral fixture shaped like the snippet above yields 0 html_content_dropped findings and 1 info removal record, with the bound form unchanged.
  • The same widget outside a bound commerce form still yields html_content_dropped.
  • The existing #6492 negatives and positives stay green.

AI assistance: drafted by an AI agent (Claude) under operator direction.

主要言語
PHP
スター
28
フォーク
5
平均マージ
2時間 53分
マージ済み PR(30日)
938

環境構築

はじめの一歩

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

Automattic/blocks-engine のほかの issue

Automattic/blocks-engine の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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