Repository navigation
Merged
Conversation
…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.
… 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
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
STRUCTURE_CONTENT_HEADERContent\ExtensionPoint\ContentPageHeader$article,$page,$contentSectionId,$function,$sliceId, modifiable$sliceRevisionSTRUCTURE_CONTENT_BEFORE_SLICESContent\ExtensionPoint\ContentPageBeforeSlices$sliceRevisionSTRUCTURE_CONTENT_AFTER_SLICESContent\ExtensionPoint\ContentPageAfterSlicesSTRUCTURE_CONTENT_SIDEBARContent\ExtensionPoint\ContentPageSidebarSTRUCTURE_CONTENT_MODULE_SELECTContent\ExtensionPoint\ContentPageModuleSelect$article,$contentSectionId,$sliceIdSLICE_BE_PREVIEWContent\ExtensionPoint\SlicePreview$sliceCAT_FORM_ADDContent\ExtensionPoint\CategoryFormAdd$parent,$languageId,$colspanCAT_FORM_EDITContent\ExtensionPoint\CategoryFormEdit$category,$colspanCAT_FORM_BUTTONSContent\ExtensionPoint\CategoryFormButtons$category(nullwhen adding),$parent,$languageIdPAGE_STRUCTURE_ARTICLE_ORDER_BYContent\ExtensionPoint\ArticleListOrder$category,$languageIdMEDIA_FORM_ADDMediaPool\ExtensionPoint\MediaFormAddMEDIA_FORM_EDITMediaPool\ExtensionPoint\MediaFormEdit$mediaMEDIA_DETAIL_SIDEBARMediaPool\ExtensionPoint\MediaDetailSidebar$mediaMEDIA_LIST_FUNCTIONSMediaPool\ExtensionPoint\MediaListFunctions$media(the@deprecatedparams are dropped)MEDIA_LIST_THUMBNAILMediaPool\ExtensionPoint\MediaListThumbnail$mediaMEDIA_LIST_TOOLBARMediaPool\ExtensionPoint\MediaListToolbar$subpage,$categoryRector rules map all old names.
Slice revision of the content page
The content page points passed
slice_revision(and the always-zero, unusedarticle_revision) by reference, and the working version listeners inboot/backend.phpchanged it viasetParam(): in the header to show the session's revision, and before the slices after copying between working and live version. Now$sliceRevisionis a modifiable property ofContentPageHeaderandContentPageBeforeSlices, and the page reads it back after dispatching them; in the other points it is readonly.Removed
PAGE_STRUCTURE_HEADER_PRE,PAGE_STRUCTURE_HEADERandPAGE_MEDIAPOOL_HEADER: no usage found in public addons, exceptPAGE_STRUCTURE_HEADERfor a deprecation notice of the theme addon. (MEDIA_LIST_THUMBNAILandMEDIA_LIST_TOOLBARwere 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 incontent.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.