Skip to content

Changelog

CmsBlockLibrary

Every released version of CmsBlockLibrary, newest first.

CMS 10 releases latest 1.5.0RepositoryDocumentation

Added

  • Shopping Experiences library — one entry under Content with a Blocks and a Sections tab replaces the separate Block library and Section library entries. The old routes redirect to the matching tab. The library no longer highlights Shopping Experiences in the main menu (the routes pointed there via parentPath).

  • Search in both library tabs (name and tags). The list pages had an onSearch() handler but no search field wired to it.

Changed

  • Service and route configuration moved from XML to YAML (services.yaml, routes.yaml); XML configuration is deprecated and no longer loaded from Shopware 6.8.

  • Typed repositories. The controllers declare EntityRepository<SavedBlockCollection> / <SavedSectionCollection> / <CmsSectionCollection> and read results via getEntities()->first() instead of the deprecated EntitySearchResult::first().

  • Admin snippets load from the snippet/ folder only. The modules no longer pass snippets to Module.register, and main.js no longer imports them — smaller bundle, same texts.

  • word-break: break-word replaced by overflow-wrap: anywhere; redundant type checks and unused catch bindings removed.

  • Store metadata: longer store descriptions (DE/EN), manufacturer and support links; plugin icon compressed to 8 kB.

Fixed

  • JSON import from the administration never reached the server (Parameter "file" is missing). The core getBasicHeaders() sets Content-Type: application/json, so the browser sent no multipart body; the header is now dropped for the upload.

  • Editing a linked block/section via its JSON editor was reverted by the next layout save. The open layout kept its old copy of the instance and pushed it back on save. After the sync, the editor now reloads the affected instances from the server (other unsaved edits on the page stay); the section settings modal closes because its section is replaced.

  • Pasting a copied linked block or section now inserts an independent copy (link markers removed, as with Unlink); a linked instance comes from Insert saved section / the Saved blocks sidebar.

  • Saving a section as linked now removes old standalone block markers (dmfSavedBlockId) from its blocks in the database, not just in memory — they kept counting under the block's usage.

  • Created at column shows a formatted date instead of the raw ISO timestamp; the section visibility hint says "section" instead of "block".

Added

  • ACL privileges for the library. New role group CMS block & section library (dmf_cms_library) under Content with viewer / editor / creator / deleter. The editor role depends on cms.editor and category.editor, because syncing a linked element rewrites CMS slots/sections in every layout that hosts it and strips category slot overrides.

  • _acl on all custom API routes. Export requires dmf_cms_saved_*:read, import …:create. Block sync requires dmf_cms_saved_block:update, cms_block:read, cms_slot:update and category:update; section sync requires dmf_cms_saved_section:update, cms_section:update, cms_block:create/delete, cms_slot:create/delete and category:update. Missing privileges return 403 FRAMEWORK__MISSING_PRIVILEGE_ERROR.

Changed

  • Admin respects the privileges. Both library modules require dmf_cms_library.viewer; import, rename, delete, bulk delete, save-to-library, edit-linked and the saved-blocks sidebar category / insert-saved tab are hidden or disabled without the matching role. Saving a layout or category with linked elements but without dmf_cms_library.editor skips the sync and shows an info notification instead of failing.

  • Proper error handling instead of console output. All console.* calls are removed. Failures the editor would care about now show a notification: list load (new dedicated message instead of the delete message), bulk delete, export, usage-modal load, sidebar saved-blocks load. Linked-element auto-sync after a layout/category save reports one aggregated warning when any sync is rejected; previously it reported success before the requests had finished.

  • No false success after a failed marker PATCH. The five copies of the customFields PATCH (visibility, save-to-library marker, unlink — blocks and sections) are replaced by one helper (service/dmf-cms-custom-fields.helper.js). When the PATCH is rejected the editor now sees a warning to save the layout instead of a success message. The section settings modal awaits the visibility persist on close.

  • No !important, core styles untouched. The empty-stage widening for the third "saved section" tile now applies only while that tile is rendered (:has(.sw-cms-stage-section-selection__dmf-saved)), so the core empty stage of new pages keeps its layout. The linked-block heading and the page-form hint use dedicated plugin selectors/wrappers.

  • Sync responses no longer contain success: true — block sync returns { id }, section sync { id, synced }.

  • shopware/core constraint narrowed from ^6.7 to ~6.7.0.

Fixed

  • Linked-block sync overwrote open layout drafts. SavedBlockController::propagateSlotConfigs() rewrote cms_slot.type and cms_slot_translation.config via raw SQL without a version_id filter, so besides the live rows it also changed every version row — including open drafts (DAL cms_page versions, e.g. from the DMF Visual Editor) of other layouts that host the same linked block. The draft silently took over the synced content in the sync language, replaced edits already made there, and the later publish reported an extra change on the live layout. Both statements are now scoped to the live version (Defaults::LIVE_VERSION), and their joins match on id and version, so a live slot never resolves its linkage through a draft block row. Drafts keep their own state and are reconciled when they are merged. Section sync was not affected (it already writes through the DAL in the live context). (#1)

Changed

  • sw-cms-stage-add-section now extends the inner sw_cms_add_section_button block instead of the outer sw_cms_add_section, so the saved-section picker sits inside .sw-cms-stage-add-section rather than turning the component root into a fragment (fragment children take their anchors from the stage's children list, which reintroduced the same patch mismatch).

  • Removed the $nextTick / close-before-mutate workarounds in sw-cms-block-config.dmfOnSaveVisibility() and dmf-section-settings-modal.onClose(). They worked around the symptom above and their comments blamed a Vue <teleport> that was never involved — visibility now mutates customFields, persists, then closes in the normal order.

  • All eight modal components accept a hostSelector prop (default 'body'), forwarded to sw-modal's selector. New shared stylesheet src/app/dmf-cms-modal-host.scss hides an idle host (.dmf-cms-modal-host:empty) so it contributes no layout.

Fixed

  • Configuring block/section visibility twice threw insertBefore errors and the modal stopped opening. Setting up visibility worked once; changing it afterwards logged NotFoundError: Failed to execute 'insertBefore' on 'Node' followed by TypeError: Cannot read properties of null (reading 'insertBefore'), and from then on the modal never reappeared. Cause: core sw-modal relocates its own root node in mountedComponent() (document.querySelector(this.selector).appendChild(this.$el), selector defaults to body) and defers $el.remove() by 400 ms. Vue's patchBlockChildren derives the patch container for a component child from hostParentNode(oldVnode.el) — after the relocation that is body — while the sibling anchors still belong to the plugin's own subtree. On open, Vue wrote its v-if placeholders into body anchored to body text nodes; on close, sw-modal's deferred removal orphaned that anchor, insertBefore threw, the host lost its placeholder, and every later open mounted into a null container. Every v-if'd modal in the plugin now renders into its own host div whose per-instance id (${this.$.uid}) is passed to sw-modal as selector, so the node is re-appended where Vue already put it and container and DOM parent stay in sync. Applied to all 12 mount sites: block settings sidebar (save / linked editor / visibility), Section settings modal (nested save + linked editor), section actions, stage add section picker, category layout form, and both library list pages (preview / edit / usage). The modal keeps rendering as a full-viewport overlay — .sw-modal stays position: fixed, no ancestor in these subtrees creates a containing block.

Fixed

  • Dropping a media library item failed with HTTP 400 ("This field was not expected"). Captured configs carried the admin's runtime schema hints (media.entity, media.required, …) which DAL's SlotConfigField rejects (allowExtraFields: false). The raw-SQL block sync tolerated them, so they polluted stored configs; the drop writes via the DAL cascade and was rejected. Configs are now sanitized to the persistable { source, value } shape on capture, on apply (repairs already-polluted masters at drop time), and in the section-sync reconcile (so a linked section containing media no longer 400s on save).

Added

  • Multi-language library snapshots (import/export per language). Saving a block/section to the library now captures every language, not just the one active in the editor, and stores it in the snapshot as configByLocale keyed by locale ISO code (de-DE, en-GB) — portable across shops. Dropping/pasting a library item writes those languages back into the new slots' cms_slot_translation rows (locales absent from the target shop are skipped; the active language keeps rendering immediately via slot.config). Export/import inherit this automatically since they round-trip the snapshot JSON. Older single-language snapshots load unchanged. New shared helper service/dmf-cms-i18n.helper.js; capture wired into block + section save, apply wired into all block/section insert paths.

Changed

  • Unlinking a section now fully detaches it. Previously unlink only dropped dmfLinked but kept dmfSavedSectionId (and the child blocks' dmfLinkedSectionId), so the detached section still counted under the library entry's In use list. Unlink now strips all library-origin markers — from the section and every child block — so it becomes a plain, independent section that no longer appears as a usage and is no longer synced. (Sections unlinked under the old behaviour keep their stale markers until re-processed.)

Fixed

  • Dropping a library item while viewing a non-default language. The apply step left the new slot's slot.config (the context-language row + what the editor renders immediately) at the snapshot's base language, only writing the other languages as explicit translations. Dropping while the admin was in a non-base language therefore showed — and, when base ≠ current, persisted — the base language's text for the current language. applySlotConfigByLocale now sets slot.config to the current language's configByLocale entry, so a drop made in German writes and shows German.

  • Linked sections — multi-language content loss. Editing a linked section in one language could overwrite the other languages, so a section maintained in German and English suddenly showed the English text in both. Cause: the section-propagation reconciler (SavedSectionController::reconcileBlocks) matched a target's existing blocks/slots to the source config by array index. Any added, removed or reordered block/slot shifted every following child onto a freshly-minted id — and a fresh cms_slot carries a cms_slot_translation row for the edited language only, so all other languages fell back to the system-default content. Blocks are now reconciled by stable identity (sectionPosition + position) and slots by their slot name, so existing ids — and with them every language's translation row — are preserved. Only genuinely new slots start single-language, exactly like any new CMS slot. Mirrors the linked-block language scoping shipped in 1.3.0.

  • Section library "Sektion bearbeiten" modal — stray "Als verknüpften Block speichern" toggle. The section-library edit modal reuses dmf-save-block-modal but did not pass hide-linked-toggle, so it showed the block-worded linked toggle even for already-linked sections. The toggle was also inert here (the edit only persists name + tags). It is now hidden, matching the block-library edit modal.

  • Linked sync wiped the library master's other languages. While a block/section was linked, every CMS page/category save fired the sync endpoint, which serializes in the edited language only and overwrote the library master snapshot — stripping the multi-language configByLocale. Dropping the (later unlinked) library entry onto a new page then rendered every language in the edited one. SavedSectionController::sync and SavedBlockController::sync now merge the single-language payload into the stored master: structure follows the payload, but each slot keeps the locales it already had and refreshes only the edited locale. The library master stays multi-language across linked edits.

Added

  • Linked sections — save a section as linked (Save as linked section in the Section settings modal). Editing any linked instance propagates its full block/slot structure (add / remove / reorder blocks + all slot configs) to every other linked instance across all pages and categories. Backed by a new is_linked column on dmf_cms_saved_section (migration 1746700000) and a new sync endpoint POST /api/_action/dmf-cms-section-library/{id}/sync.

  • Section library Type column — the Section library list now shows a Linked / Static badge, matching the Block library.

  • Category "Layout" linked marking + usage modal — the category layout form shows a hint banner above the inheritance banner when the layout hosts linked elements, plus a clickable blue Linked section / Linked block badge on each linked element. Clicking a badge opens a usage modal listing every CMS layout that hosts the element and the categories / landing pages assigned to it (current category highlighted, per-layout instance count).

  • CMS-builder stage badges — linked blocks and linked sections now show a blue Linked block / Linked section badge on the stage; the section badge sits at the top-left of sw-cms-section__wrapper.

  • Delete cleanup — deleting a linked block/section from the library now unlinks its live instances (markers stripped → they become plain static copies, content preserved) via a delete-event subscriber.

Changed

  • Cross-category propagation — linked-element edits made in the category Layout tab now propagate. Core sw-category-detail.onSave() persists only the category, so the plugin fires the sync endpoints on save (last-edit-wins across categories).

  • Per-category slot overrides no longer shadow linked content — on every sync, category_translation.slot_config entries for linked slots are stripped, so a linked element always renders the shared, propagated content. Rule: linked = always shared; unlink an element first to give it a per-category variant. Non-linked overrides are preserved.

  • Section sync reuses ids — the section propagation reconciles blocks/slots by reusing existing ids (minting new only for added children, deleting only the surplus) instead of regenerating them, so a versioned page draft never orphans its references.

  • Propagation is admin-triggered — the always-on in-page live mirroring and debounced live library sync were removed. Linked changes now propagate on CMS page save, on category save, and via the Edit linked block / section editor modals.

Fixed

  • Multi-language — linked-block config propagation is now scoped to the edited language (sw-language-id header + cms_slot_translation.language_id filter). Editing a linked block in one language no longer overwrites the other languages.

  • Duplicate instances — when the same linked block/section appears more than once on a page, the edited instance is now identified by comparing against the library baseline, so editing the second (or any) copy no longer loses the edit.

  • Section save 400 — saving a page containing a linked section no longer fails with type/position should not be blank (id-reuse) and sizing_mode never writes NULL.

  • Category save 400 — removed a redundant full cms_page save from the category write-through.

  • Missing styling for the linked panel in the Section settings modal.

Added

  • Section-level visibility controls in the Section settings modal (gear icon → new Sichtbarkeit / Visibility tab):

    • Display rule — pick a Shopware Rule Builder rule; section is hidden when the rule does not match (silent hide).
    • Schedule — from / until datetime range; section is hidden outside the window.
  • Visibility state stored under cms_section.custom_fields.dmfSectionVisibility. Persisted on modal close via PATCH /cms-section/{id} (no DAL migration).

  • Twig override on @Storefront/storefront/page/content/detail.html.twig gates section rendering server-side around the page_content_section block.

Added

  • New Sichtbarkeit / Visibility section in the CMS block settings sidebar with an Edit visibility rules button that opens a modal:

    • Display rule — pick a Shopware Rule Builder rule; block is hidden when the rule does not match the current sales-channel context (silent hide).
    • Schedule — from / until datetime range; block is hidden outside the window.
  • Visibility state stored under cms_block.custom_fields.dmfBlockVisibility — no DAL migration.

  • Twig override on @Storefront/storefront/section/cms-section-block-container.html.twig gates block rendering server-side.

Changed

  • DmfCmsBlockLibrary::getTemplatePriority() returns 100 so the visibility wrapper composes after lower-priority CMS section overrides (e.g. DmfCmsDynamicGrid).

Added

  • Saved Blocks library with admin overview under Inhalte → Erlebniswelten Block-Übersicht.

  • "Save as block" quickaction in the CMS block settings sidebar.

  • "Saved blocks" picker category with drag-drop to stage.

  • JSON import / export endpoints (/api/_action/dmf-cms-block-library/{import,export}).

  • Block copy / paste-before / paste-after quickactions (sessionStorage clipboard).

  • Section copy / paste-before / paste-after context-menu items.

  • DAL entity dmf_cms_saved_block (auto-CRUD via REST + search routes).

  • German and English snippets.