Commit 5ab775df authored by jrockowitz's avatar jrockowitz

Issue #3001740: Telephone Link field formatter InvalidArgumentException with 5...

Issue #3001740: Telephone Link field formatter InvalidArgumentException with 5 digits or fewer in the number
parent ad0276a4
......@@ -96,17 +96,6 @@ class Telephone extends TextBase {
$format = $this->getItemFormat($element);
switch ($format) {
case 'link':
/**********************************************************************/
// Issue #2484693: Telephone Link field formatter breaks Drupal with 5
// digits or less in the number
// return [
// '#type' => 'link',
// '#title' => $value,
// '#url' => \Drupal::pathValidator()->getUrlIfValid('tel:' . $value),
// ];
// Workaround: Manually build a static HTML link.
/**********************************************************************/
$t_args = [':tel' => 'tel:' . $value, '@tel' => $value];
return t('<a href=":tel">@tel</a>', $t_args);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment