Skip to content

[Bug] PEES-1714: Warn when block template editable names keep the placeholder index - #4251

Merged
jcPimcore merged 1 commit into
2025.4from
fix/PEES-1714-warn-unreplaced-block-placeholder
Oct 22, 2026
Merged

jcPimcore merged 1 commit into
2025.4from
fix/PEES-1714-warn-unreplaced-block-placeholder

Conversation

@jcPimcore

@jcPimcore jcPimcore commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Changes in this pull request

Jira: PEES-1714 (no GitHub issue to resolve)

Relates https://github.com/pimcore/service-operations/issues/1399

processBlockTemplate in block-editable/utils/template-processor.ts now logs one console.warn when an editable name still contains 1000000 or 1000001 after the placeholder replacement. The warning points to reload(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 is reload(true) on the block; the warning makes the situation visible to template authors.

Additional info

  • New test 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 --noEmit exit 0, full jest run 56 suites / 425 tests passed.
  • Not yet exercised in a running Studio build.
  • BC: no break. Frontend only; the change only adds a console warning.
  • Complementary docs PR in pimcore/pimcore documents the reload(true) requirement.

🤖 Generated with Claude Code

…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>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 13:01
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 1000000 or 1000001, recommending reload(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

@jcPimcore jcPimcore self-assigned this Oct 22, 2026
@jcPimcore jcPimcore added this to the 2025.4.19 milestone Oct 22, 2026
@jcPimcore
jcPimcore merged commit f6f5ecc into 2025.4 Oct 22, 2026
17 of 18 checks passed
@jcPimcore
jcPimcore deleted the fix/PEES-1714-warn-unreplaced-block-placeholder branch October 22, 2026 13:19
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants