Add core_version_requirement: ^8 || ^9 to international_phone.info.yml to designate that the module is compatible with Drupal 9. See https://drupal.org/node/3070687.

Comments

mo_farhaz created an issue. See original summary.

mo_farhaz’s picture

Assigned: mo_farhaz » Unassigned
Status: Active » Needs review
StatusFileSize
new430 bytes

please review

burningdog’s picture

Status: Needs review » Needs work

The patch applies but the module has an error in that it tries to access removed code, namely SafeMarkup::checkPlain() which was deprecated in Drupal 8 and removed in Drupal 9:

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Util...

Switching to use \Drupal\Component\Utility\Html::escape() instead allowed for the module to be installed and an international_phone field can be added to a content type. However, there are the following problems:

* it uses the hard-coded Street label instead of the label given in the field settings

The JavaScript fails with
* Uncaught TypeError: e.indexOf is not a function in JQuery, tracing back to line 56 of intlTelInput.js
* Uncaught TypeError: $(...).intlTelInput is not a function.

Instead, I've switched to using https://www.drupal.org/project/phone_international

edsoncarlos’s picture

StatusFileSize
new2.09 KB
renatog’s picture

Status: Needs work » Reviewed & tested by the community

#4 really looks good

kunalgautam’s picture

#4 working file for me. can it merge this into the current module?

rescudero’s picture

StatusFileSize
new2.38 KB

The patch was giving me an error adding core_version_requirement: ^ 8 || ^ 9
I have modified that part and it has worked for me

rescudero’s picture

StatusFileSize
new2.12 KB

I upload the corrected patch, the previous one had the path of the file with my own project