[v14.2+] Allow custom views to load correctly for Block List #2515
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.
Description
When adding a custom view for Block List items, there is sometime an instance where the custom view will not load.
Types of changes
Motivation and context
This appears to be happening due to a race condition between
#extensionSlotFilterMethod
and#renderBlock
inblock-list-entry.element.ts
, wherethis._contentTypeAlias
doesn't have a value before the filter method runs.This appears to have been fixed by @nielslyngsoe in the Block Grid code based on this comment...
https://github.com/umbraco/Umbraco.CMS.Backoffice/blob/main/src/packages/block/block-grid/components/block-grid-entry/block-grid-entry.element.ts#L389
How to test?
headline-umbraco-demo-block-id
block to the Block List onall-property-editors-document-id
indocument.data.ts
, around line 269block-custom-view
manifest in the examples folder (I did this inentry-point.ts
)It does appear to work if you add a headline block to the Block List without making any of these changes, but not if loading the page with the data already in the Block List.
Screenshots (if appropriate)
Before any changes:
After adding the new Block to the List:
After registering the custom view:
After applying the PR changes:
Checklist