Captured slideshow pass overwrites the route path, aborting compose with a rebind() TypeError

オープン 初心者向け
#5,003 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

キャプチャしたスライドショーのパスにある CapturedDialogProjector.php から始め、特に $path を再利用する内側のループと、その後の $retired[$path] および $bindings->rebind($files, $path) の呼び出しを確認してください。ページの各反復でルートパスが固定されるように、内側の変数名を変更してください。メディアが見つからない場合も既存の $missing の動作で引き続き処理され、compose が rebind() の TypeError を起こさずに完了し、誤ったファイルキーが記録されなければ完了です。

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

説明

Summary

In CapturedDialogProjector's captured-slideshow pass (added in #3811), the outer loop variable $path holds the route's HTML file path. Two inner loops reuse the same name and overwrite it:

  • $path = $assets[$media['asset'] ?? ''] ?? null; sets it to null when a frame's media asset was not captured.
  • foreach (array_slice($paths, $used) as $path) sets it to a relative image path.

After the page changes, the pass calls $retired[$path] = … and $bindings->rebind($files, $path) with the overwritten value:

  • null aborts the whole compose: TypeError: ScriptOccurrenceBindings::rebind(): Argument #2 ($sourcePath) must be of type string, null given (CapturedDialogProjector.php:218).
  • An image path silently rebinds scripts and records retired runtimes under the wrong file key.

Reproduction

A real Square Online store (an import from www.braveyogimedicinals.com) fails with the TypeError above on php-transformer v0.45.312 (SSI v1.33.426, DLA v0.33.168). Any page with a captured carousel/slideshow component whose frame references a media asset that is missing from the asset map, alongside a frame that still gets materialized, reproduces the bug.

Expected

The route file path stays fixed for the whole page iteration. A frame with an uncaptured asset is reported as missing (existing $missing behavior), and compose completes.

Fix

Rename the inner variables (for example $assetPath and $extraPath) so the outer $path is never reassigned.

AI disclosure: Claude Opus via Pi (Franklin agent) traced this from the failing import and wrote the issue.

主要言語
PHP
スター
25
フォーク
3
平均マージ
2時間 23分
マージ済み PR(30日)
942

環境構築

はじめの一歩

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

Automattic/blocks-engine のほかの issue

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

似ている issue

PHP の issue をもっと見る

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

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