Problem/Motivation

We are accidentally overwriting the variable item_types on: \Drupal\tmgmt\Form\SourceOverviewForm::buildForm

      foreach ($item_types as $item_types => $item_label) {
        $options[(string) $definition['label']][$type . ':' . $item_types] = $item_label;

The last $item_types item will end up in $item_types...
Didn't check more when it'striggered.

Proposed resolution

Fix... ;-)

Comments

miro_dietiker created an issue. See original summary.

berdir’s picture

Yes, but there's no actual functional bug here as $item_types itself is initialized inside the wrapping foreach and not re-used afterwards. $item_type on the other hand does exist and using that would actually result in bugs, so we need a new variable name.

znak’s picture

Status: Active » Needs review
StatusFileSize
new753 bytes

Maybe, this will help you

berdir’s picture

StatusFileSize
new1.16 KB

I think those variable names are better...

berdir’s picture

Status: Needs review » Fixed

Committed.

  • Berdir committed 6aa8844 on 8.x-1.x
    Issue #2840330 by Berdir, Znak: Variable clash in SourceOverviewForm
    

Status: Fixed » Closed (fixed)

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