During the import process my client data didn't have leading zeros for their Boston locations. Going back to add the leading zeros through the node edit form the entry wouldn't update. The database was correct, it was using varchar. After poking around I figured it was something to do with optimization, location not updating the database if values were the same. Somewhere in the code php is doing a comparison of "2139" and "02139" but probably not checking types, so it ends up treating "02139" as an int type "2139". The comparison checks out that the values are the same and the database isn't updated.

You can get around this two ways. By hand, I only had a handful of entries so this was my solution. You change the value entirely. "2139" => "02138". Then update again to the right number "02138" => "02139" If you have more than just a handful of items and are encountering this problem, go to the database and fix it there. I won't bother to show you how since im feeling like this is a edge case, but I would like to see it fixed.

If you guys who know location like the back of your hand know where this comparison takes place, much obliged if you can fix it. For all I know it may actually be a deeper problem with nodes, but I'm putting this bug here since I found it dealing with location.

If I scrape some time together I'll dive in to find the problem and post the patch here. Otherwise, I hope this helps someone dealing with this obscure issue.

Comments

kongoji’s picture

Hi,
i posted a patch here: #1032790: Leading zeros Location field content is saved wrong
It should fix your issue too.

legolasbo’s picture

Status: Needs work » Closed (outdated)

Closing old D6 issues as D6 is end of life