Skip to content

refactor!: replace the backend extension points of structure and media pool with typed classes - #6789

Merged
gharlan merged 4 commits into
6.xfrom
handler
Oct 21, 2026
Merged

gharlan merged 4 commits into
6.xfrom
handler

Conversation

@gharlan

@gharlan gharlan commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Third and last step of the structure/media pool extension point cleanup (after #6784 and #6785): the backend UI extension points become typed classes, the unused ones are removed.

Typed

old new carries
STRUCTURE_CONTENT_HEADER Content\ExtensionPoint\ContentPageHeader $article, $page, $contentSectionId, $function, $sliceId, modifiable $sliceRevision
STRUCTURE_CONTENT_BEFORE_SLICES Content\ExtensionPoint\ContentPageBeforeSlices same, modifiable $sliceRevision
STRUCTURE_CONTENT_AFTER_SLICES Content\ExtensionPoint\ContentPageAfterSlices same, readonly
STRUCTURE_CONTENT_SIDEBAR Content\ExtensionPoint\ContentPageSidebar same, readonly; subject: the meta sidebar
STRUCTURE_CONTENT_MODULE_SELECT Content\ExtensionPoint\ContentPageModuleSelect $article, $contentSectionId, $sliceId
SLICE_BE_PREVIEW Content\ExtensionPoint\SlicePreview $slice
CAT_FORM_ADD Content\ExtensionPoint\CategoryFormAdd $parent, $languageId, $colspan
CAT_FORM_EDIT Content\ExtensionPoint\CategoryFormEdit $category, $colspan
CAT_FORM_BUTTONS Content\ExtensionPoint\CategoryFormButtons $category (null when adding), $parent, $languageId
PAGE_STRUCTURE_ARTICLE_ORDER_BY Content\ExtensionPoint\ArticleListOrder $category, $languageId
MEDIA_FORM_ADD MediaPool\ExtensionPoint\MediaFormAdd –
MEDIA_FORM_EDIT MediaPool\ExtensionPoint\MediaFormEdit $media
MEDIA_DETAIL_SIDEBAR MediaPool\ExtensionPoint\MediaDetailSidebar $media
MEDIA_LIST_FUNCTIONS MediaPool\ExtensionPoint\MediaListFunctions $media (the @deprecated params are dropped)
MEDIA_LIST_THUMBNAIL MediaPool\ExtensionPoint\MediaListThumbnail $media
MEDIA_LIST_TOOLBAR MediaPool\ExtensionPoint\MediaListToolbar $subpage, $category

Rector rules map all old names.

Slice revision of the content page

The content page points passed slice_revision (and the always-zero, unused article_revision) by reference, and the working version listeners in boot/backend.php changed it via setParam(): in the header to show the session's revision, and before the slices after copying between working and live version. Now $sliceRevision is a modifiable property of ContentPageHeader and ContentPageBeforeSlices, and the page reads it back after dispatching them; in the other points it is readonly.

Removed

PAGE_STRUCTURE_HEADER_PRE, PAGE_STRUCTURE_HEADER and PAGE_MEDIAPOOL_HEADER: no usage found in public addons, except PAGE_STRUCTURE_HEADER for a deprecation notice of the theme addon. (MEDIA_LIST_THUMBNAIL and MEDIA_LIST_TOOLBAR were removed at first, but are used by lottie, roadie and quick_navigation, so they are kept as typed classes.)

Side effects

With the typed points psalm infers the page variables precisely, which removes 14 baseline lines and turned up redundant (int) casts of the slice revision in content.php (removed).

Tested

Content editor with the working version enabled (switching to the working version, adding a slice there, copying it to live — the revisions in the DB are correct), structure page with category add/edit form, media list, upload and detail page.

…a pool with typed classes

    STRUCTURE_CONTENT_HEADER        -> Content\ExtensionPoint\ContentPageHeader
    STRUCTURE_CONTENT_BEFORE_SLICES -> Content\ExtensionPoint\ContentPageBeforeSlices
    STRUCTURE_CONTENT_AFTER_SLICES  -> Content\ExtensionPoint\ContentPageAfterSlices
    STRUCTURE_CONTENT_SIDEBAR       -> Content\ExtensionPoint\ContentPageSidebar
    STRUCTURE_CONTENT_MODULE_SELECT -> Content\ExtensionPoint\ContentPageModuleSelect
    SLICE_BE_PREVIEW                -> Content\ExtensionPoint\SlicePreview
    CAT_FORM_ADD                    -> Content\ExtensionPoint\CategoryFormAdd
    CAT_FORM_EDIT                   -> Content\ExtensionPoint\CategoryFormEdit
    CAT_FORM_BUTTONS                -> Content\ExtensionPoint\CategoryFormButtons
    PAGE_STRUCTURE_ARTICLE_ORDER_BY -> Content\ExtensionPoint\ArticleListOrder
    MEDIA_FORM_ADD                  -> MediaPool\ExtensionPoint\MediaFormAdd
    MEDIA_FORM_EDIT                 -> MediaPool\ExtensionPoint\MediaFormEdit
    MEDIA_DETAIL_SIDEBAR            -> MediaPool\ExtensionPoint\MediaDetailSidebar
    MEDIA_LIST_FUNCTIONS            -> MediaPool\ExtensionPoint\MediaListFunctions

They carry the article, category, slice or medium instead of ids and SQL objects. The content page points pass the
slice revision as a property instead of a reference param; `ContentPageHeader` and `ContentPageBeforeSlices` allow
extensions to change it, as the working version does. The always-zero `article_revision` param is dropped.

`PAGE_STRUCTURE_HEADER_PRE`, `PAGE_STRUCTURE_HEADER`, `PAGE_MEDIAPOOL_HEADER`, `MEDIA_LIST_TOOLBAR` and
`MEDIA_LIST_THUMBNAIL` are removed.
@gharlan gharlan added this to the REDAXO 6.0 milestone Oct 21, 2026
… as typed classes

`MEDIA_LIST_THUMBNAIL` and `MEDIA_LIST_TOOLBAR` are used by addons (lottie, roadie, quick_navigation), so they stay
as `MediaListThumbnail` and `MediaListToolbar` instead of being removed.
# Conflicts:
#	boot/backend.php
#	pages/structure/content.php
#	src/Content/ArticleContentEditor.php
@gharlan
gharlan merged commit af70a14 into 6.x Oct 21, 2026
15 checks passed
@gharlan
gharlan deleted the handler branch October 21, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants