Does nothing... how to troubleshoot?

Created on 26 May 2023, over 1 year ago
Updated 4 August 2023, over 1 year ago

I'm not sure what the issue is. There are no errors, its just not doing anything. I'm using the core telephone field. Its not even trying to link the number even when that option is on. It just spits it out exactly as it was put into the field. I've tried different formats with no luck. I even tried the example in the screenshot (98765432) but that didn't work because Drupal said its an invalid number. I tried using the Telephone validation module but that's not doing anything either. I got errors about formatting it wrong, but they all seem to be from drupal. I can put in a number like (555) 555-5555 or 555-555-5555 and it doesn't care.

As best as I can tell, the required libraries are installed. It's here: vendor/giggsey/libphonenumber-for-php

What am I missing here?

Drupal 9.5.8
PHP 8.0.27
Telephone formatter: 8.x-1.2
Telephone Validation: 8.x-2.4

πŸ› Bug report
Status

Needs review

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States fallenturtle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @fallenturtle
  • Status changed to Closed: cannot reproduce over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States fallenturtle
  • πŸ‡ΊπŸ‡ΈUnited States fallenturtle

    Started working after a while. Don't know why.

  • πŸ‡¨πŸ‡¦Canada dtarc

    We had a similar issue with this module "just not working" with no error message or anything else.

    The issue for us was that is the number is invalid, ie. the area code doesn't exist, then the formatting doesn't happen, and no error message is output anywhere. This makes it very confusing. We sanitize our database for dev work, and our sanitization process just randomizes the phone numbers, which led to invalid phone numbers.

    I don't know if this was the same issue the OP had.

    If the number isn't valid then an exception is thrown and then caught here in this funcion:

      public function viewElements(FieldItemListInterface $items, $langcode) {
        $element = [];
        foreach ($items as $delta => $item) {
          try {
            if ($this->getSetting('link')) {
              $element[$delta] = $this->viewLinkValue($item);
            }
            else {
              $element[$delta] = $this->viewFormattedValue($item);
            }
          }
          catch (\Exception $e) {
            $element[$delta] = $this->viewPlainValue($item);
          }
        }
    
        return $element;
      }
    

    A watchdog message should be logged if the exception is thrown.

  • Status changed to Needs review over 1 year ago
  • Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.2 & MySQL 8
    last update over 1 year ago
    Waiting for branch to pass
  • πŸ‡¨πŸ‡¦Canada dtarc

    Here's the patch.

Production build 0.71.5 2024