以编程方式更新时配置文件 2 出错

Error in profile 2 while updating programatically

EntityMalformedException:类型 profile2 的实体缺少包 属性。在 entity_extract_ids()

如果用户不存在配置文件2,通常会出现此错误。请确保您正在更新的用户是否具有有效的配置文件实体。您可以使用函数 profile2_load_by_user($account, $type_name = NULL).

检查 profile2

谢谢。