Problem/Motivation
Notice: Undefined index: #preferred_countries in Drupal\phone_international\Element\PhoneInternationalElement::processInternationalPhone() (line 103 of modules/contrib/phone_international/src/Element/PhoneInternationalElement.php).
Drupal\phone_international\Element\PhoneInternationalElement::processInternationalPhone(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 1007)
Drupal\Core\Form\FormBuilder->doBuildForm('my_details_form', Array, Object) (Line: 1070)
Drupal\Core\Form\FormBuilder->doBuildForm('my_details_form', Array, Object) (Line: 574)
Drupal\Core\Form\FormBuilder->processForm('my_details_form', Array, Object) (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm('\Drupal\module\Form\GuestMyDetailsForm', Object) (Line: 219)
Drupal\Core\Form\FormBuilder->getForm('\Drupal\module\Form\GuestMyDetailsForm', Array) (Line: 128)
...
Steps to reproduce
Use module
Proposed resolution
Change
'data-exclude' => $element['#exclude'] ? implode("-", $element['#exclude_countries']) : [],
'data-preferred' => $element['#preferred'] ? implode("-", $element['#preferred_countries']) : [],
to
'data-exclude' => $element['#exclude'] ? implode("-", $element['#exclude']) : [],
'data-preferred' => $element['#preferred'] ? implode("-", $element['#preferred']) : [],
Comments
Comment #2
shriaas+1 for this, key names in
getInfo()andprocessInternationalPhone()are different which creates this issue.I will create an MR for this.
Comment #4
shriaasComment #5
shriaasThe
PhoneInternationalDefaultWidgetis using#preferred_countriesand#exclude_countrieseverywhere hence updated the name of properties ingetInfo()method ofPhoneInternationalElementclass.Comment #7
saidatom@ollie-db & @Shriaas thanks for finding and fixing the error.