Advanced

GetFinds returning NULL for owner

GetFinds returning NULL for owner
April 29, 2022 08:12PM
Next week I will release an update for GetFinds().

For geocaches where the owner have had their account deleted at Geocaching.com the owner-id is today set to 1 and name to [DELETED USER]. This is something Geocaching.com has added a while back.

This thread makes us aware that not all scripts handles that, which is understandable. There are two approaches to go here. Either scripts has to handle the magic ID 1 and a special username, or we just replace those with invalid values.

I have chosen to replace those values with NULL. The result is that some scripts might fail after the update. But then at least they won't give faulty results. The fix for the scripts will probably be to check that owner_id and/or placed_by isn't null in a loop. But fix will of course vary for each affected script.

I feel this change is better than using the ID=1 which will be a magic number most new scripts will miss handling.

There are currently 233 enabled scripts that has the word owner_id in them. That's 231 potentially affected scripts. Some of them are just using the value to check that the one running the checker isn't the owner of what he logged. These checks will probably still work.
Re: GetFinds returning NULL for owner
May 29, 2022 09:54PM
This causes an error in GentlePurpleRain's "Number of caches with word in the title." (https://project-gc.com/Tools/Challenges?edit&addTag&scriptId=613). On line 146, the script concatenates cache.owner_id to a string. This fails if owner_id is nil.

It looks like GentlePurpleRain hasn't logged in recently. Can this still be fixed?



Edited 1 time(s). Last edit at 05/29/2022 09:55PM by Hügh. (view changes)
Re: GetFinds returning NULL for owner
May 29, 2022 09:56PM
There are two ways to fix this. Either I edit his script for him, or someone makes a fixed fork and I move all tags from his script to the new one.
Re: GetFinds returning NULL for owner
May 29, 2022 09:59PM
I've clone his script and am working on a fix. I will let you know when I finish.
Re: GetFinds returning NULL for owner
May 29, 2022 10:01PM
Thanks. Just write the ID of the former and new script and I can transfer tags. But not until tomorrow, bedtime here.
Re: GetFinds returning NULL for owner
May 29, 2022 10:09PM
Sounds good.

OLD: 613
NEW: 8665
Re: GetFinds returning NULL for owner
May 30, 2022 10:15AM
Wow, popular script. I just moved 753 tags. Thank you for 1) making us aware, 2) forking and fixing.
Sorry, you do not have permission to post/reply in this forum.