You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to update users with the IP address because I have a lot of users to update.
I tried several type IP (normal, hexa, integer, ...) withouth any success. $acc = \Drupal\user\Entity\User::load($shop_uid); $acc->set("field_ipaddress",$ip); $res = $acc->save();
Wath do I have to do here?
Thanks in advance,
Regards,
Adrien.
The text was updated successfully, but these errors were encountered:
It is a little more complicated than that, if you don't go through the normal entity form field.
Have a look at Plugin\Field\FieldWidget\IpAddressWidgetBase::massageFormValues() - as you can see there are three sub elements (ip_from, ip_to and ipv6). The first two are identical for single IP numbers. They are encoded using inet_pton().
Hello,
I'm trying to update users with the IP address because I have a lot of users to update.
I tried several type IP (normal, hexa, integer, ...) withouth any success.
$acc = \Drupal\user\Entity\User::load($shop_uid); $acc->set("field_ipaddress",$ip); $res = $acc->save();
Wath do I have to do here?
Thanks in advance,
Regards,
Adrien.
The text was updated successfully, but these errors were encountered: