Issue Category
Other
Bug Description
The Maps markers API endpoint (/api/maps/markers) silently drops two
fields on creation and update: notes and marker_type. The DB
schema and the MapMarker model include both fields, and they are
returned correctly by GET /api/maps/markers, but the VineJS
validators in admin/app/controllers/maps_controller.ts do not
whitelist them in either createMarker or updateMarker. Fields
sent in the request body are accepted with a 200 status, silently
discarded, and stored as null (or default).
Additionally, the updateMarker validator does not accept
latitude or longitude, so a marker's position cannot be changed
after creation via the API.
Related: the UI's marker popup also does not render the notes
field even when it has been set via direct DB manipulation, but that
is a separate front-end issue.
Steps to Reproduce
-
POST a marker with a notes field:
curl -X POST http://:8080/api/maps/markers
-H 'Content-Type: application/json'
-H 'X-CSRF-TOKEN: '
-d '{"name":"test","latitude":45,"longitude":-93,"color":"red","notes":"hello"}'
Response: 200, but the returned marker object has no notes field.
-
Confirm persistence with GET /api/maps/markers: the newly created
marker shows "notes": null.
-
Attempt to set notes via PATCH:
curl -X PATCH http://:8080/api/maps/markers/
-H 'Content-Type: application/json'
-H 'X-CSRF-TOKEN: '
-d '{"notes":"hello"}'
Response: 200 with full marker object, but notes is still null.
-
Same behavior for marker_type. Tried alternate field names
(note, description, comment, details, label, info,
text, body) — all ignored.
-
PATCH also does not accept latitude/longitude, so markers
cannot be repositioned via the API.
Expected Behavior
POST and PATCH on /api/maps/markers should accept notes and
marker_type fields per the existing DB schema and model. PATCH
should additionally accept latitude and longitude to allow
marker repositioning.
Actual Behavior
Requests succeed with HTTP 200, but notes, marker_type,
latitude, and longitude (on update) are silently dropped by the
VineJS validators in admin/app/controllers/maps_controller.ts
(methods createMarker and updateMarker). The fields never reach
the model or database.
Root cause is in the inline validator schemas. The create validator
only whitelists name, latitude, longitude, color. The update
validator only whitelists name and color. Adding the missing
fields to both schemas (and the corresponding model assignments)
resolves the issue.
N.O.M.A.D. Version
1.31.1
Operating System
Ubuntu 24.04
Docker Version
29.3.1
Do you have a dedicated GPU?
Yes
GPU Model (if applicable)
NVIDIA Gforce 3090TI
System Specifications
AMD 7950X3D
32GB
4tb nvme
2tb nvme
4tb SATA
Service Status (if relevant)
No response
Relevant Logs
Browser Console Errors (if UI issue)
Screenshots
No response
Additional Context
The fix is localized to admin/app/controllers/maps_controller.ts.
Both validators need additional fields added, and the corresponding
model assignments extended. I have a working patch and am happy to
submit a PR.
Specifically:
createMarker: add notes and marker_type to the vine schema,
and pass them through to MapMarker.create(...).
updateMarker: add notes, marker_type, latitude, and
longitude to the vine schema, and add matching
if (payload.X !== undefined) marker.X = payload.X lines.
Optionally: add range validation on lat/lon (-90..90, -180..180).
Currently the create endpoint accepts any number.
Pre-submission Checklist
Issue Category
Other
Bug Description
The Maps markers API endpoint (
/api/maps/markers) silently drops twofields on creation and update:
notesandmarker_type. The DBschema and the
MapMarkermodel include both fields, and they arereturned correctly by
GET /api/maps/markers, but the VineJSvalidators in
admin/app/controllers/maps_controller.tsdo notwhitelist them in either
createMarkerorupdateMarker. Fieldssent in the request body are accepted with a 200 status, silently
discarded, and stored as
null(or default).Additionally, the
updateMarkervalidator does not acceptlatitudeorlongitude, so a marker's position cannot be changedafter creation via the API.
Related: the UI's marker popup also does not render the
notesfield even when it has been set via direct DB manipulation, but that
is a separate front-end issue.
Steps to Reproduce
POST a marker with a
notesfield:curl -X POST http://:8080/api/maps/markers
-H 'Content-Type: application/json'
-H 'X-CSRF-TOKEN: '
-d '{"name":"test","latitude":45,"longitude":-93,"color":"red","notes":"hello"}'
Response: 200, but the returned marker object has no
notesfield.Confirm persistence with GET /api/maps/markers: the newly created
marker shows
"notes": null.Attempt to set notes via PATCH:
curl -X PATCH http://:8080/api/maps/markers/
-H 'Content-Type: application/json'
-H 'X-CSRF-TOKEN: '
-d '{"notes":"hello"}'
Response: 200 with full marker object, but
notesis still null.Same behavior for
marker_type. Tried alternate field names(
note,description,comment,details,label,info,text,body) — all ignored.PATCH also does not accept
latitude/longitude, so markerscannot be repositioned via the API.
Expected Behavior
POST and PATCH on /api/maps/markers should accept
notesandmarker_typefields per the existing DB schema and model. PATCHshould additionally accept
latitudeandlongitudeto allowmarker repositioning.
Actual Behavior
Requests succeed with HTTP 200, but
notes,marker_type,latitude, andlongitude(on update) are silently dropped by theVineJS validators in
admin/app/controllers/maps_controller.ts(methods
createMarkerandupdateMarker). The fields never reachthe model or database.
Root cause is in the inline validator schemas. The create validator
only whitelists
name,latitude,longitude,color. The updatevalidator only whitelists
nameandcolor. Adding the missingfields to both schemas (and the corresponding model assignments)
resolves the issue.
N.O.M.A.D. Version
1.31.1
Operating System
Ubuntu 24.04
Docker Version
29.3.1
Do you have a dedicated GPU?
Yes
GPU Model (if applicable)
NVIDIA Gforce 3090TI
System Specifications
AMD 7950X3D
32GB
4tb nvme
2tb nvme
4tb SATA
Service Status (if relevant)
No response
Relevant Logs
Browser Console Errors (if UI issue)
Screenshots
No response
Additional Context
The fix is localized to
admin/app/controllers/maps_controller.ts.Both validators need additional fields added, and the corresponding
model assignments extended. I have a working patch and am happy to
submit a PR.
Specifically:
createMarker: addnotesandmarker_typeto the vine schema,and pass them through to
MapMarker.create(...).updateMarker: addnotes,marker_type,latitude, andlongitudeto the vine schema, and add matchingif (payload.X !== undefined) marker.X = payload.Xlines.Optionally: add range validation on lat/lon (
-90..90,-180..180).Currently the create endpoint accepts any number.
Pre-submission Checklist