Repository navigation
[Bug] PEES-1714: Warn when block template editable names keep the placeholder index - #4251
Merged
jcPimcore merged 1 commit intoOct 22, 2026
Merged
Conversation
…ceholder index Editable names built from the block index (e.g. "details" ~ _block.getCurrentIndex()) keep the placeholder key when a new block item is created from the template, so content set in the new item is saved under a name that is not read after a reload. Log a warning that points to reload(true) on the block. No behaviour change otherwise. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The diagnostic-only change preserves existing processing behavior, includes focused regression tests, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Adds a diagnostic warning to Studio’s block-template processing when editable names retain placeholder indices, helping template authors identify names that can cause content to disappear after reload.
Changes:
- Emits one warning per processing call when editable names still contain
1000000or1000001, recommendingreload(true). - Adds two regression tests covering successful placeholder replacement and warning behavior without changing processed names.
| File | Description |
|---|---|
| assets/js/src/core/modules/element/dynamic-types/definitions/document/editable/components/block-editable/utils/template-processor.ts | Detects remaining placeholder indices and logs guidance without altering template processing. |
| assets/js/src/core/modules/element/dynamic-types/definitions/document/editable/components/block-editable/utils/template-processor.test.ts | Tests normal replacement and the warning for retained placeholders. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Changes in this pull request
Jira: PEES-1714 (no GitHub issue to resolve)
Relates https://github.com/pimcore/service-operations/issues/1399
processBlockTemplateinblock-editable/utils/template-processor.tsnow logs oneconsole.warnwhen an editable name still contains1000000or1000001after the placeholder replacement. The warning points toreload(true). There is no other behaviour change.Why: a block template that builds an editable name from the block index (for example
"details" ~ _block.getCurrentIndex()) breaks for newly added block items. Studio renders new items from a placeholder template whose names keep the placeholder index (details0/details1000001), so content set in the new item is saved under a name that is not read after reload. The documented fix isreload(true)on the block; the warning makes the situation visible to template authors.Additional info
template-processor.test.ts(2 tests). Verified locally in Docker (node:24): the new test failed before the change (0 warnings, 1 expected) and passes after. eslint exit 0,tsc --noEmitexit 0, full jest run 56 suites / 425 tests passed.reload(true)requirement.🤖 Generated with Claude Code