Problem/Motivation
Can't add phone number or address to contact. (email addresses are fine)
Steps to reproduce
1. Install CRM
2. Navigate to a contact entity add form (e.g. `/crm/contact/add/person`) or edit form (e.g. `/crm/contact/3/edit`)
3. Click "Add new telephone" (or "Add new address")
4. Enter a phone number and click "Create telephone" (or "Create address")
Expected:
Telephone number (or address) created
Actual:
Resulting AJAX request errors and telephone number (or address) is not created:
Error: Object of class Drupal\telephone\Plugin\Field\FieldType\TelephoneItem could not be converted to string in Drupal\crm\Entity\ContactDetail\TelephoneContactDetail->label() (line 21 of /var/www/html/src/Entity/ContactDetail/TelephoneContactDetail.php).
TypeError: strlen(): Argument #1 ($string) must be of type string, Drupal\telephone\Plugin\Field\FieldType\TelephoneItem given in strlen() (line 397 of /var/www/html/web/core/lib/Drupal/Component/Utility/Unicode.php)
TypeError: strlen(): Argument #1 ($string) must be of type string, Drupal\address\Plugin\Field\FieldType\AddressItem given in strlen() (line 397 of /var/www/html/web/core/lib/Drupal/Component/Utility/Unicode.php)
Proposed resolution
Remaining tasks
Issue fork crm-3541270
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jdleonardComment #3
jdleonardComment #5
jdleonardOnly lightly tested. The code makes more sense to me this way.
Comment #8
bluegeek9 commented