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/pianoanalytics yields a single hit for tracking_scope — the #group reference itself.
  • There is no $form['tracking_scope'] with '#type' => 'vertical_tabs' (or any other parent element type) in buildForm(), 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.

Command icon 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

mably created an issue. See original summary.

mably changed the visibility of the branch 3589789-pianoanalyticssettingsform-drop-the to hidden.

mably’s picture

Status: Active » Needs review

  • mably committed 4b16c3b0 on 2.x
    fix: #3589789 PianoAnalyticsSettingsForm: drop the orphan '#group' => '...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.