PianoAnalyticsSettingsForm::buildForm() declares:
$form['linktracking'] = [
'#type' => 'details',
'#title' => $this->t('Links and downloads'),
'#group' => 'tracking_scope',
];
The #group key tells Form API to move this details element into the form element keyed tracking_scope. However, no such parent element is declared anywhere in the form:
- Grepping the entire 2.x branch of
project/pianoanalyticsyields a single hit fortracking_scope— the#groupreference itself. - There is no
$form['tracking_scope']with'#type' => 'vertical_tabs'(or any other parent element type) inbuildForm(), in any alter hook in the module, or in any submodule.
Drupal's #group resolver silently no-ops a reference whose target does not exist, so the linktracking details renders as a standalone collapsible block. The intent (a tabbed grouping) is lost, but the form still works.
Proposed fix
Remove the '#group' => 'tracking_scope' line. The form has no other declared tracking_scope container, so the reference is dead weight. If a vertical-tabs layout is wanted in the future, the parent element can be added back deliberately at that point.
Context
Spotted while reviewing a downstream module that copied the same pattern when adding details elements to the form via hook_form_FORM_ID_alter(). Removing the reference upstream lets downstream code avoid mirroring a dead group key.
Issue fork pianoanalytics-3589789
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
Comment #4
mably commentedComment #6
mably commented