Skip to content

Commit 6d2b0ca

Browse files
committed
Fixed repeating of value in autocomplete lists when the label is the same.
1 parent 236337b commit 6d2b0ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Drush/Commands/CodeBuilderDrushCommands.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,9 @@ protected function interactCollectProperties(DataItem $data, $breadcrumb): void
479479
$results[' '] = '-- None --';
480480
}
481481
foreach ($matched_keys as $key) {
482-
$results[$key] = $key . ' - ' . $options[$key]->getLabel();
482+
// TODO: See https://github.com/drupal-code-builder/drupal-code-builder/issues/334.
483+
$label = $options[$key]->getLabel();
484+
$results[$key] = $key . (($key == $label) ? '' : ' - ' . $label);
483485
}
484486

485487
return $results;

0 commit comments

Comments
 (0)