I use the "mobile_number" module ( https://www.drupal.org/project/mobile_number → ) to store the phone number field for my users, however that field's property_type is "mobile_number", even though the value itself is a string. As a result, it lands on the default case in the switch statement in saveUserInfo.
-Install mobile_number module
-Add mobile_number field to user info
-Map the new field in opened_connect settings to phone
-Login
A generic solution (which I tested and works fine for this specific case), would be to test if the claim_value is a string in the default case of the switch statement and save it as if the property_type was indeed a string. Additional error checking would possibly required as I don't know if other field types might throw an exception if, for example, an improperly formatted string was saved.
There may be a more robust solution involving available field entity iteration and custom mapping, but it would almost certainly be overkill.
Here is the code change I tested in saveUserInfo:
default:
// Handle property types added by other modules (such as mobile_phone) if they are strings
if (is_string($claim_value)) {
$account->set($property_name, $claim_value);
break;
}
$this->logger->error('Could not save user info, property type not implemented: %property_type',
['%property_type' => $property_type]
);
break;
Active
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.