Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The "geom" property within the Geofield data is a binary object which cannot be serialized to JSON.
This causes a serious issue when using the Services module to retrieve nodes and / or views as JSON. The data cannot be returned as json_encode() fails.
Comments
Comment #1
Brandonian CreditAttribution: Brandonian commented@dankobiaka, we've recently committed some code in the dev branch that converts our geom column to wkt on load for just such edge cases as this. Let me know if this works for you.
http://drupalcode.org/project/geofield.git/commit/8e4f3f7
Comment #3
dankobiaka CreditAttribution: dankobiaka commentedI can't confirm the DEV branch fixed this issue. The branch actually caused a lot of other fatal problems (especially related to the GeoPHP auto-format detection) so I had to downgrade immediately.
Comment #4
Brandonian CreditAttribution: Brandonian commented@dankobiaka, can you open a separate issue with specifics?
Comment #5
jpstrikesback CreditAttribution: jpstrikesback commentedI can confirm that this only fixes the issue for entity updates. When an entity is first saved we still experience issues with services modules that implement hook_node_insert. The reason is that when an entity is first saved and we use hook_field_presave the node object is a reference and it's data is passed exactly as stored if I understand this note from Ryan Szrama correctly.
Field attach API? Thoughts?
Comment #6
giorgio79 CreditAttribution: giorgio79 commentedSomewhat related: binary data breaks mongodb migration as well #2022281: Ability to specify Mongo Bin Data for fields Will be testing the dev branch. Hope it fixes the issue.
I think this should be handled by mongodb, but any interim solution would be great. :)
Comment #7
ceepeebee CreditAttribution: ceepeebee commenteddue to the binary storage of geom, dpm($view) et al don't work in hook_view_....() either