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

Error assigning areas without geofields to movements #236

Closed
alexadamsmith opened this issue Oct 5, 2019 · 6 comments
Closed

Error assigning areas without geofields to movements #236

alexadamsmith opened this issue Oct 5, 2019 · 6 comments
Labels
Milestone

Comments

@alexadamsmith
Copy link
Collaborator

alexadamsmith commented Oct 5, 2019

I've stumbled across an error in the new movement/ mapping functionality. This occurs when I add a movement to a log, or modify an existing movement. Specifically, the error popps up when add an area that lacks a geofield using the 'movement to' selector. Areas that have geofields (whether polygons, multipolygons, etc) are not affected. The error does not cause the app to crash, but the area without a geofield is not added to the movement.

`[Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'geom' of undefined"

found in

---> at src/client/components/Autocomplete.vue
at src/client/components/EditLog.vue
at src/client/components/Logs.vue
at src/client/App.vue

warn @ vue.esm.js?a026:628
logError @ vue.esm.js?a026:1893
globalHandleError @ vue.esm.js?a026:1888
handleError @ vue.esm.js?a026:1848
invokeWithErrorHandling @ vue.esm.js?a026:1871
invoker @ vue.esm.js?a026:2188
invokeWithErrorHandling @ vue.esm.js?a026:1863
Vue.$emit @ vue.esm.js?a026:3891
selectSearchResult @ Autocomplete.vue?b669:82
click @ Autocomplete.vue?8338:85
invokeWithErrorHandling @ vue.esm.js?a026:1863
invoker @ vue.esm.js?a026:2188
original._wrapper @ vue.esm.js?a026:7559
vue.esm.js?a026:1897 TypeError: Cannot read property 'geom' of undefined
at VueComponent.addMovementArea (EditLog.vue?ca5d:664)
at results (EditLog.vue?f0e4:1053)
at invokeWithErrorHandling (vue.esm.js?a026:1863)
at VueComponent.invoker (vue.esm.js?a026:2188)
at invokeWithErrorHandling (vue.esm.js?a026:1863)
at VueComponent.Vue.$emit (vue.esm.js?a026:3891)
at VueComponent.selectSearchResult (Autocomplete.vue?b669:82)
at click (Autocomplete.vue?8338:85)
at invokeWithErrorHandling (vue.esm.js?a026:1863)
at HTMLLIElement.invoker (vue.esm.js?a026:2188)`

@mstenta
Copy link
Member

mstenta commented Oct 5, 2019

Ah probably the code that automatically copies the area geometry into the map needs to fail more gracefully.

@mstenta mstenta added the bug label Oct 5, 2019
@jgaehring
Copy link
Member

So I believe to reproduce, we need to create an area on the server, which is just a name, essentially, with no geometry assigned, then try to add that area to a movement log, is that correct, @alexadamsmith?

The problem seems to be located here: https://github.com/farmOS/farmOS-client/blob/975e16b2769d97e9a901db03bbbdd6c323b0d5bd/src/client/components/EditLog.vue#L664

Presumably just adding a null-check at that line would resolve the issue.

@mstenta
Copy link
Member

mstenta commented Nov 22, 2019

Came across this issue myself in testing (#256 ), forgot we had an issue open for it already. :-)

Relevant from that issue:

Movements in farmOS do not require geometries. The only thing the do require is an area reference. So Field Kit needs to be able to reference an area without a geometry.

@alexadamsmith
Copy link
Collaborator Author

I can look into this one over Thanksgiving too, since I was looking into it earlier as well

@alexadamsmith
Copy link
Collaborator Author

This should take care of it

@jgaehring
Copy link
Member

Resolved by #271.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants