diff --git a/core/lib/Drupal/Core/Render/Element/Radio.php b/core/lib/Drupal/Core/Render/Element/Radio.php index 7f87b92..4eb34ac 100644 --- a/core/lib/Drupal/Core/Render/Element/Radio.php +++ b/core/lib/Drupal/Core/Render/Element/Radio.php @@ -37,6 +37,22 @@ public function getInfo() { ); } + /** + * Helper function to cast bool values to string. + * + * @param bool $value + * A bool value which would be casted to string. + * + * @return string + * The casted value of the bool value. + */ + protected static function castValue($value) + { + if (is_bool($value) || (string) (int) $value === (string) $value) { + return (string) (int) $index; + } + } + /** * Prepares a #type 'radio' render element for input.html.twig. *