Bug / UX issue
In the homepage block editor, the category for a latestPages block is a free-form <TextInput> with placeholder "news". Editors must know the exact category name and type it manually. Typos silently produce an empty block (because HomepageRenderer::resolveLatestPages does a case-insensitive name match, and a miss returns no pages).
Current code
assets/components/BlockEditModal.tsx:185-201:
<TextInput
label={label('categorySlug')}
value={(editedBlock.categorySlug as string) ?? ''}
onChange={(event) => updateBlock('categorySlug', event.currentTarget.value || null)}
placeholder="news"
/>
src/Service/HomepageRenderer.php:185-215 resolves the category by case-insensitive English-name match — fragile if the category is renamed.
Fix
- Add an admin endpoint that returns categories for the current channel (use existing
MenuCategoryRepository::findAllOrdered($channel)).
- Replace the
<TextInput> with a Mantine <Select> (or <Autocomplete>) populated from that endpoint.
- Store the category ID (or stable slug) in the block payload instead of the display name; update
HomepageRenderer::resolveLatestPages to look up by ID/slug instead of name match.
- Add a migration step to rewrite existing
latestPages blocks to the new identifier.
Files
assets/components/BlockEditModal.tsx:185-201
src/Service/HomepageRenderer.php:185-215
src/Entity/MenuCategory.php (channel relation already exists, lines 42-44)
- New admin controller endpoint (e.g.
AdminHomepageController or a dedicated AdminMenuCategoryController)
Verification
- Open the homepage block editor; the category field shows a dropdown of channel categories.
- Select a category; save; reload the page editor — selection persists.
- Render the homepage; the block shows pages from the selected category.
- Renaming a category does not break the block (because we store the ID, not the name).
Bug / UX issue
In the homepage block editor, the category for a
latestPagesblock is a free-form<TextInput>with placeholder"news". Editors must know the exact category name and type it manually. Typos silently produce an empty block (becauseHomepageRenderer::resolveLatestPagesdoes a case-insensitive name match, and a miss returns no pages).Current code
assets/components/BlockEditModal.tsx:185-201:src/Service/HomepageRenderer.php:185-215resolves the category by case-insensitive English-name match — fragile if the category is renamed.Fix
MenuCategoryRepository::findAllOrdered($channel)).<TextInput>with a Mantine<Select>(or<Autocomplete>) populated from that endpoint.HomepageRenderer::resolveLatestPagesto look up by ID/slug instead of name match.latestPagesblocks to the new identifier.Files
assets/components/BlockEditModal.tsx:185-201src/Service/HomepageRenderer.php:185-215src/Entity/MenuCategory.php(channel relation already exists, lines 42-44)AdminHomepageControlleror a dedicatedAdminMenuCategoryController)Verification