Problem when tag a friend without selecting from list

Henry Djunaedi Posted in Component Development 9 years ago

In Wall Post, when creating a post and tag a friend, the list sometime takes long time to show. During that time, user would just hit enter. If this happens, the friend's name is written into database instead of the GUID.
In ossn_object, "post":"test","friend":"john"
The correct is "post":"test","friend":"1"

The result is broken HTML on wall page.

Replies
Indonesian Henry Djunaedi Replied 9 years ago

thanks for the reply. the function works, but it seems my logic doesn't
Although it's now safe from broken html, now it doesn't tag the friend's name
I'll continue on github

Indonesian Arsalan Shah Replied 9 years ago

To check guid try to use function below :

ossn_user_by_guid(xx) 

Please report issue to github

Indonesian Henry Djunaedi Replied 9 years ago

it doesn't work if the input tag is all numeric and not actual guid. Need a function to check if the value is a valid guid.

Help

Indonesian Henry Djunaedi Replied 9 years ago

never mind. i kinda fix it, .. i think.

OssnWall.php

public function Post() {

...

            if(!empty($friends)) { if(is_numeric($friends)) { $wallpost['friend'] = $friends;}}

...

}