Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'source' tag at upload time defaults to 'undefined' when empty #5021

Closed
skylerbunny opened this issue May 5, 2018 · 3 comments
Closed

'source' tag at upload time defaults to 'undefined' when empty #5021

skylerbunny opened this issue May 5, 2018 · 3 comments
Labels
bug A bug - let's fix this!

Comments

@skylerbunny
Copy link

tl;dr : When no 'sources' are defined from previous iD edits (or I have cleared them in previous iD edits), the default for the next time should be no sources whatsoever, not the source 'undefined' as a character string.

If you upload a change using the iD editor, one of the selections available to you is the 'Sources'.

If in a previous iD editing session, you have explicitly defined one or more Sources, these will (still) appear in the box, on the assumption that you want to use them again. (E.g., if I previously said 'survey', the box will have in it:)

( [x] survey ) ( Add ... )

BUT -- If I subsequently delete 'survey' and upload with no source defined, I can successfully do so. (See https://www.openstreetmap.org/changeset/58716992 ) Here's the problem. The NEXT time I edit and upload, the default ( [x] undefined ) appears, see https://www.openstreetmap.org/changeset/58717013 . This shouldn't happen.

@skylerbunny
Copy link
Author

It looks like #4993 successfully prevents an empty source value from being written, but the real thing that should be done here is to 'not write the source key at all if no value is provided'. In other words, "undefined" is not a value, it's the lack of one and no key should be written.

@bhousel bhousel added the bug A bug - let's fix this! label May 6, 2018
@bhousel
Copy link
Member

bhousel commented May 13, 2018

Thanks @skylerbunny I just fixed this. I also added some code to ignore and remove any literal 'undefined' source value that might have been written to localStorage. Because the saved source/comment/hashtags expire after 2 days, this code can go away in iD v2.9.

@bhousel
Copy link
Member

bhousel commented May 13, 2018

this was closed by 644985c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug - let's fix this!
Projects
None yet
Development

No branches or pull requests

2 participants