Old input values get lost within fields-loop
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 50/100
調査の方向性
Reproduce with the snippet from the report: form:create exposes old as the full array, and the fields tag with scope="field" should narrow it to the current field's value but returns null instead. Locate the form:create and fields tag implementations and see how old is added to the cascade versus how the loop builds its scoped context. The regression appeared between 6.42 and 6.44, so diff that range; done looks like {{ old }} printing the current field's previous value inside the loop while still being the array outside it.
索引モデルが issue の本文から書いたものです。
説明
Bug description
After upgrading from 6.42 to 6.44 I noticed, that input values from previous inputs (old variable) aren't available within the fields loop.
{{ old }} is always null within a field. So something like the below won't work.
<!-- /vendor/statamic/forms/fields/default.antlers.html -->
<input {{ old ?= 'value="{old}"' }} />
<!-- End: /vendor/statamic/forms/fields/default.antlers.html -->
How to reproduce
Before we are within the fields loop, old outputs the whole array of values. Within the loop, old become null whilst it should be the value of the field we are looping.
{{ form:create :in="form:handle ?? form_handle" js="alpine:form" attr:x-ref="form" }}
{{ old | dump }} ===> THIS WORKS as intended: array of all values
{{# Render various form sections. #}}
{{ sections }}
{{ old | dump }} ===> STILL WORKS: array
{{# Render the default-styled fields. #}}
{{ fields scope="field" }}
{{ old | dump }} ===> DOESNT WORK: old is null instead of the value of the current field
{{ /fields }}
{{ /sections }}
{{ /form:create }}
### Logs
```shell
Environment
Environment
Laravel Version: 13.44.1
PHP Version: 8.5.12
Composer Version: 2.10.0
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: Europe/Vienna
Locale: de
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: NOT CACHED
Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / daily
Mail: smtp
Queue: database
Session: file
Storage
public/storage: NOT LINKED
Locales
Installed: de, en, sk
LaravelLang\Lang\Plugin: 15.39.2
Locales Version: 2.11.0
Protected: de, en
Publisher Version: 16.9.0
Livewire
Livewire: v4.4.10
Statamic
Addons: 8
License Key: Set
Sites: 3 (Deutsch, English, Slovak)
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.44.0 PRO
Statamic Addons
marcorieser/statamic-livewire: 6.0.0-beta.1
rias/statamic-redirect: 4.2.5
schantldev/statamic-newsletter: 6.x-dev
schantldev/statamic-phosphoricons: 2.0.1
spatie/statamic-responsive-images: 6.2.0
stillat/meerkat: 4.0.2
studio1902/statamic-peak-seo: 11.9.6
studio1902/statamic-peak-tools: 9.2.3
Installation
Existing Laravel app
Additional details
No response
- 主要言語
- PHP
- スター
- 4.9k
- フォーク
- 647
- 平均マージ
- 1日 45分
- マージ済み PR(30日)
- 221
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
statamic/cms のほかの issue
-
forms ui
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
accessibility
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
antlers
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
Nav: link to the site root with an anchor (/#section) gets is_parent on every page対応中かも @duncanmcclean が今日担当しました。 オープンnavigations
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Multiple Choice and Checkboxes no longer offer "Inline", but the default views still use it対応中かも @duncanmcclean が今日担当しました。 オープンforms
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
sync-en
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
vimeo/psalm#15150 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
taskforcesh/bullmq#5238 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects it対応中かも @bfs2021 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Automattic/jetpack#55517 ·
メンテナーはふだん 1 日以内に返信