Repository navigation
Merged
Conversation
… and media manager with typed classes
ART_PRE_DELETED -> Content\ExtensionPoint\ArticleDeleting
ART_IS_PERMITTED -> Content\ExtensionPoint\ArticlePermissionCheck
CAT_IS_PERMITTED -> Content\ExtensionPoint\CategoryPermissionCheck
MEDIA_IS_PERMITTED -> MediaPool\ExtensionPoint\MediaPermissionCheck
ART_STATUS_TYPES -> Content\ExtensionPoint\ArticleStatusTypes
CAT_STATUS_TYPES -> Content\ExtensionPoint\ArticleStatusTypes
ART_CONTENT -> Content\ExtensionPoint\ArticleContentOutput
ART_INIT -> Content\ExtensionPoint\ArticleContentRendering
ART_SLICES_QUERY -> Content\ExtensionPoint\ArticleSlicesQuery
URL_REWRITE -> Content\ExtensionPoint\ArticleUrl
MEDIA_URL_REWRITE -> MediaPool\ExtensionPoint\MediaUrl
MEDIA_LIST_QUERY -> MediaPool\ExtensionPoint\MediaListQuery
MEDIA_MANAGER_URL -> MediaManager\ExtensionPoint\MediaManagerUrl
The status of a category is the one of its start article, so there is one list of status types:
`CategoryHandler::statusTypes()`, `nextStatus()` and `prevStatus()` are removed in favor of the `ArticleHandler`
methods, and `ArticleStatusTypes` replaces both former extension points.
`ArticleUrl` and `MediaUrl` have `null` as subject, which keeps the default URL. `MediaListQuery` provides the query
parameters as a modifiable property instead of a reference param, and tells the count query of a paginated list apart.
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.
Second step of the remaining structure/media pool extension point cleanup (after #6784): the extension points carrying data (deletion, permissions, status types, rendering, URLs, queries) become typed classes.
ART_PRE_DELETEDContent\ExtensionPoint\ArticleDeleting$article(slices still exist)ART_IS_PERMITTEDContent\ExtensionPoint\ArticlePermissionCheckbool;$articleCAT_IS_PERMITTEDContent\ExtensionPoint\CategoryPermissionCheckbool;$categoryMEDIA_IS_PERMITTEDMediaPool\ExtensionPoint\MediaPermissionCheckbool;$mediaART_STATUS_TYPES,CAT_STATUS_TYPESContent\ExtensionPoint\ArticleStatusTypesART_CONTENTContent\ExtensionPoint\ArticleContentOutput$content,$contentSectionIdART_INITContent\ExtensionPoint\ArticleContentRendering$contentART_SLICES_QUERYContent\ExtensionPoint\ArticleSlicesQuery$contentURL_REWRITEContent\ExtensionPoint\ArticleUrl?string(null= default URL);$articleId,$languageId,$paramsMEDIA_URL_REWRITEMediaPool\ExtensionPoint\MediaUrl?string(null= default URL);$mediaMEDIA_LIST_QUERYMediaPool\ExtensionPoint\MediaListQuery$params,$countMEDIA_MANAGER_URLMediaManager\ExtensionPoint\MediaManagerUrl$type,$fileName,$busterStatus types merged
The status of a category is stored as the status of its start article, yet there were two lists of status types with separate extension points. An addon extending only one of them (accessdenied registers the same listener for both) would let them diverge. Now there is one list:
ArticleStatusTypesreplaces both points, andCategoryHandler::statusTypes()/nextStatus()/prevStatus()are removed in favor of theArticleHandlermethods (rector rules included).Further changes
ArticleUrl/MediaUrlusenullinstead of''for "keep the default URL".MediaListQueryprovides the query parameters as a modifiable property instead of a reference in the params, and$counttells the count query of a paginated list apart. As before, the data query already containsORDER BY/LIMITwhen it is dispatched.boot/frontend.phpuse the typed points; their comments claiming that the article id is unknown inART_INITwere outdated and are corrected.Media::isPermitted()no longer needs itsreturn.tooWideBoolignore; the psalm baseline shrinks.Tests
New
MediaHandlerTest::testMediaListQueryCanBeExtended(count and data query, params). Smoke-tested structure page, media pool list/search, content editor and frontend.