diff --git a/core/modules/config_translation/src/FormElement/ListElement.php b/core/modules/config_translation/src/FormElement/ListElement.php index d7a082f..9d65d2f 100644 --- a/core/modules/config_translation/src/FormElement/ListElement.php +++ b/core/modules/config_translation/src/FormElement/ListElement.php @@ -135,20 +135,19 @@ protected function getGroupTitle(DataDefinitionInterface $definition, array $gro } /** - * Get compound element key. + * Gets a compound element key. * - * @param $base_key - * The base key. - * - * @param $key + * @param string|null $base_key + * The base key or NULL of this is the top-level element. + * @param string $key * The sub-key. * * @return string + * The compound element key. */ protected function getElementKey($base_key, $key) { - return implode('.', array_filter(array($base_key, $key), function ($value) { - return isset($value); - })); + // Account for the fact that $base_key might be NULL. + return ltrim("$base_key.$key", '.'); } }