留言板

Programmatically change User Portrait

Yannick Weinz,修改在12 年前。

Programmatically change User Portrait

Junior Member 帖子: 69 加入日期: 10-11-15 最近的帖子
Hi,

got a problem with the updatePortrait(String Id, byte[] bytes) funktion of the UserLocalServiceUtil.

Short version: It doesn't work

Long Version: If i don't change the Portrait at least once with the control panel, this doesn't work. After changing it once with the control panel, i can change the portrait programmatically with the afore mentioned method.

Anyone knows y that is so and how i can fix that?

Thanks in advance,

Yannick
Yannick Weinz,修改在12 年前。

RE: Programmatically change User Portrait

Junior Member 帖子: 69 加入日期: 10-11-15 最近的帖子
Can noone help me with that?
Yannick Weinz,修改在12 年前。

RE: Programmatically change User Portrait

Junior Member 帖子: 69 加入日期: 10-11-15 最近的帖子
push
thumbnail
Hitoshi Ozawa,修改在12 年前。

RE: Programmatically change User Portrait

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
What kind of error are you gettings? "Doesn't work" is too abstract for anyone to reply.
Yannick Weinz,修改在12 年前。

RE: Programmatically change User Portrait

Junior Member 帖子: 69 加入日期: 10-11-15 最近的帖子
Thats what a long version was for...

I don't get any error, it's just that nothing really happens.

I have to first use the control panel to change the Portrait of a user, after that i can change it with the afore mentioned command. But this doesnt work out of the box and i get no error message or something similiar what so ever
thumbnail
Hitoshi Ozawa,修改在12 年前。

RE: Programmatically change User Portrait

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
Are you using UserLocalServiceUtil instead of UserServiceUtil? Anyways, isn't portraitId suppose to be 0 when there isn't any portrait?