Following a patch to the way user profile information is dealt with, here's a patch that fixes the way that location information is displayed there. It also includes lat/long information where present.

CommentFileSizeAuthor
#3 location_9.patch1.54 KBankur
user_hook.patch1.01 KBgeodaniel

Comments

geodaniel’s picture

This is against 4.7b4 by the way

geodaniel’s picture

Oh, there is an issue when a user adds a location but then removes it - the 'place:' tag is left there but with no information. The condition used to check if there is location information or not is count($user->location) but this returns the number of elements (12) even if there is no information stored in that array. Any thoughts on a best way to get around this issue?

ankur’s picture

Status: Needs review » Fixed
StatusFileSize
new1.54 KB

I committed a slightly different version of the patch (see attachment) to HEAD. This patch is different from the original submission in that it only displays the lat/lon coordinates if the user has the 'submit latitude/longitude' permission. The worry about whether or not the location is empty is taken care of by replacing

count($user->location)

with

!_location_is_empty($user->location)
Anonymous’s picture

Status: Fixed » Closed (fixed)