-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Geolocation cannot be stored when creating a new note via API #3884
Comments
Updating the note via the API sets the desired values, so I would assume the above really is a bug? #!/bin/sh
id=e4f8f38ca8b94e03b9948a5dd332fb77
curl -XPUT http://localhost:41184/notes/${id}?token=${token} --data '{
"latitude": "48.8568",
"longitude": "2.2927"
}' when I run the {
"id": "e4f8f38ca8b94e03b9948a5dd332fb77",
"parent_id": "4a5daf15f3cd4353a9e63bcaa74f8930",
"title": "Test001",
"body": "Check location",
"created_time": 1602246270426,
"updated_time": 1602253646979,
"is_conflict": 0,
"latitude": "48.85680000",
"longitude": "2.29270000",
"altitude": "0.0000",
"author": "jpmens",
"source_url": "",
"is_todo": 0,
"todo_due": 0,
"todo_completed": 0,
"source": "joplin-desktop",
"source_application": "net.cozic.joplin-desktop",
"application_data": "",
"order": 1602246270426,
"user_created_time": 1602246270426,
"user_updated_time": 1602253646979,
"encryption_cipher_text": "",
"encryption_applied": 0,
"markup_language": 1,
"is_shared": 0,
"type_": 1
} and see there, the UI shows me the location: and finally, when I [
{
"id": "e4f8f38ca8b94e03b9948a5dd332fb77",
"parent_id": "4a5daf15f3cd4353a9e63bcaa74f8930",
"title": "Test001",
"body": "Check location",
"created_time": 1602246270426,
"updated_time": 1602253646979,
"is_conflict": 0,
"latitude": "48.85680000",
"longitude": "2.29270000",
"altitude": "0.0000",
"author": "jpmens",
"source_url": "",
"is_todo": 0,
"todo_due": 0,
"todo_completed": 0,
"source": "joplin-desktop",
"source_application": "net.cozic.joplin-desktop",
"application_data": "",
"order": 1602246270426,
"user_created_time": 1602246270426,
"user_updated_time": 1602253646979,
"encryption_cipher_text": "",
"encryption_applied": 0,
"markup_language": 1,
"is_shared": 0,
"type_": 1
}, |
I thought I had the latest version. I've updated the issue to reflect that I've now tested with
It behaves identically with respect to this issue: a new note doesn't add the geolocation data, but a subsequent |
It turns out there's a whitelist of note properties that can be set when creating or updating a note, and geolocation was not in them. I've now added support for this too so it will be in the next version. |
Thank you for fixing this! I confirm that |
I'm creating a new note using the API and wish to set geolocation information on the note. I specifically use strings for
latitude
andlongitude
because that's how the API returns an existing note (see below). Using JSON numbers makes no difference: the result is the same.Environment
Joplin version:
1.2.6 (prod, darwin)
Platform: macOS
OS specifics:
macOS 10.15.6
Steps to reproduce
I run that small shell script:
{"title":"Test001","body":"Check location","parent_id":"4a5daf15f3cd4353a9e63bcaa74f8930","author":"jpmens","is_todo":0,"markup_language":1,"updated_time":1602246270426,"created_time":1602246270426,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","order":1602246270426,"id":"e4f8f38ca8b94e03b9948a5dd332fb77","user_updated_time":1602246270426,"user_created_time":1602246270426,"type_":1}
The note is created, but when I verify using the
(I)
button in the UI theLocation
field is not populated (I can edit it).All other note attributes I've tested (author, url, etc.) work fine.
Exporting a note which I've created in the Joplin UI with Location pasted into the field, and exporting my above test note produce the following diff (the API-created note has "0.0000" for
latitude
andlongitude
:Left (
<
) file is the one created/edited in the UI, and the right (>
) file is the one created via the APIDescribe what you expected to happen
I expected the note to contain
latitude
andlongitude
and to see that in the UI, and I expect aGET
of the note would provide the fields in its JSON.Logfile
The text was updated successfully, but these errors were encountered: