### Problem/Motivation
`BuilderMenuItems::getDerivativeDefinitions()` reads `$menu['menu_parent']` inside `str_replace()` before the `?? 'system.admin_config'` fallback:
$menu = $configPageType->get('menu');
$parentMenu = str_replace('admin:', '', $menu['menu_parent']) ?? 'system.admin_config';
When a config page type has no menu configured, `$configPageType->get('menu')` returns NULL, so `$menu['menu_parent']` throws "Trying to access array offset on null" on every cache rebuild. The `??` is also misplaced: it guards the return value of `str_replace()` (never NULL), not the array access.
### Steps to reproduce
Create a translatable config pages type with no menu configured, then run `drush cr`:
[warning] Trying to access array offset on null BuilderMenuItems.php:51
### Proposed resolution
Guard the array access with `isset()` while keeping the intended default:
$parentMenu = isset($menu['menu_parent']) ? str_replace('admin:', '', $menu['menu_parent']) : 'system.admin_config';
### Remaining tasks
Review and commit the MR.
### User interface changes
None.
### API changes
None.
### Data model changes
None.
Issue fork translatable_config_pages-3605984
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments