Bio text is erased when user update basic information

Rafael [redcrested.net] Posted in General Discussion 2 years ago

Today I noted when updating a user's profile, bio text (from bio component) is erased. Anyone else passed through this issue?

Replies
Breton Rafael [redcrested.net] Replied 2 years ago

Michael

Thank you for updating Bio component so fast. I'm glad to help :-)

After sending this question, I start to find a solution. I don't look into bio component but in Profile.

I'm using as reference github code, because I maded few modifications into this files. When profile/action/edit.php (https://github.com/opensource-socialnetwork/opensource-socialnetwork/blob/v6.x/components/OssnProfile/actions/edit.php) is called, line 21 with "$fields = ossnuserfields_names();" call any user field from database. Foreach on line 23 set $user[$field] = input($field); but if field isnt into form, the field is set to empty.

So, I add an if into the foreach to save only existing fields into the user form

if (input($field)){
    $user[$field] = input($field);
}

I'll keep this solution because fit my need at this moment.

German Michael Z├╝lsdorff Replied 2 years ago

Confirmed and fixed with Bio 6.5

Thanks for reporting, Rafael.