Skip to content

Commit d8f74bb

Browse files
authored
Fix getOption() calls to use empty string instead of null (#621)
Replace null with `''` in `SelectElement::getOption()`, since the placeholder options for select elements are keyed by an empty string, not null.
1 parent 13e4dcb commit d8f74bb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

library/Vspheredb/Monitoring/Rule/RuleForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ protected function setInheritedValue($elementName, $value, $sourceName = null)
170170
} elseif ($optionValue === false) {
171171
$optionValue = 'n';
172172
}
173-
$element->getOption(null)->setContent(
173+
$element->getOption('')->setContent(
174174
implode(',', $element->getOption($optionValue)->getContent()) . $suffix
175175
);
176176
} elseif ($element instanceof TextElement || $element instanceof NumberElement) {

library/Vspheredb/Web/Form/InfluxDbConnectionForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ protected function appendVersionInformation($apiVersion, $detectedVersion)
178178
}
179179
$element = $this->getElement('api_version');
180180
assert($element instanceof SelectElement);
181-
$autoOption = $element->getOption(null);
181+
$autoOption = $element->getOption('');
182182
$autoOption->setLabel(\sprintf(
183183
$this->translate('Autodetect: %s API, Version is %s'),
184184
$apiVersion,

0 commit comments

Comments
 (0)