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.
Hello,
there is a problem with ajax calls on fields on node edit. I think its related with the widget module but i am not sure.
Here is the original issue, posted for the geoPHP module,
Only NDR (little endian) SKB format is supported at the moment
Comment | File | Size | Author |
---|---|---|---|
#12 | geometry_type_reset_incorrectly_ajax_calls-2456915-12.patch | 792 bytes | bennybobw |
#11 | geometry_type_reset_incorrectly_ajax_calls-2456915-11.patch | 718 bytes | bennybobw |
#9 | geom-type-ajax-2456915-9.patch | 975 bytes | smithmilner |
#6 | geophp_error_on_ajax-2456915-6.patch | 1.62 KB | haggins |
#5 | geophp_error_on_ajax-2456915-5.patch | 1.54 KB | haggins |
Comments
Comment #1
Breakerandi CreditAttribution: Breakerandi commentedCan anybody figure out which module is the problem or which two modules can't work together?
Comment #2
Schnitzer CreditAttribution: Schnitzer commentedComment #3
jasom CreditAttribution: jasom commented--
Comment #4
haggins CreditAttribution: haggins at Berger Schmidt commentedHere's a patch that fixes the problem for me. It basically tests if the form submission is relevant for this module and cancels further execution when it's not.
Comment #5
haggins CreditAttribution: haggins at Berger Schmidt commentedExtended the patch as there still a problem persisted when clicking on the remove button of an image field.
Comment #6
haggins CreditAttribution: haggins at Berger Schmidt commentedThis one also considers upload buttons.
All in all I'd say this can be only a temporary workaround. There must be a more general solution.
Comment #7
mitche42 CreditAttribution: mitche42 as a volunteer commentedThe patch didn't work for me.
Somehow the leaflet widget's ajax is causing problems for the image field's ajax.I have the same issues with the Remove/Upload buttons not working correctly on a Multiupload Imagefield (also tested with Image field).
Bug Test: In an image field on a node/add or edit form I select images to upload -> click upload -> the images show up in rows (row weight toggle link is broken/dragdrop feature broken) -> click Remove -> (page responds as if Save was clicked) -> returned to node/add or edit if there were form errors, those messages are displayed and the image field weight toggle link works again. If there weren't form errors, the node is saved and the user is redirected to that node, with the image clicked for removal not removed.
With the patch the only difference for me was after clicking Remove, the form error for the geofield isn't shown and the geofield disappears off of the page (Remove button still behaves like the Save button).
Comment #8
mitche42 CreditAttribution: mitche42 as a volunteer commentedMy problem was solved with the solution from this thread (http://www.drupal.org/node/2034071)
Comment #9
smithmilner CreditAttribution: smithmilner as a volunteer commentedDefinitely a problem with ajax calls on the same form. Obviously the form isn't being rebuilt correctly. I'm attaching a patch to fix the "Only NDR (little endian) SKB format is supported at the moment" issue that I'm having during ajax calls.
Comment #10
bennybobw CreditAttribution: bennybobw commentedI'm updating the title of this issue to be more . The patch in #9 is incorrect because it will break when the ajax call actually does contain the leaflet widget values. The code in question is this:
which was added in commit 862fd0678 with message:
Comment #11
bennybobw CreditAttribution: bennybobw commentedAttaching a patch to check if the values for the field instance are in the form_state. I think this will fix the issue and keep the code that correctly changes the geometry type on relevant ajax calls. I'm not quite sure how to test it though.
Comment #12
bennybobw CreditAttribution: bennybobw commentedWe were having some more problems with this, so I went back and took a deeper look. The patch in #9 is correct. Here's the context. This comment is no longer true as of the latest version of the geofield module:
In fact geofield_compute_values calls geofield_geometry_from_values which calls geofield_get_values_from_geometry and that function returns a correct array of values that matches the field definition, not something in WKB format. So it's safe to remove the entire conditional as the patch in #9 does. I'm attaching a renamed version of the patch in #9, just so it's clear that this is the correct patch.
Comment #13
pixelsweatshop CreditAttribution: pixelsweatshop commentedCan confirm #12 fixes issue.
Comment #14
sano CreditAttribution: sano as a volunteer commentedworks for me as well.
Drupal core 7.59
Leaflet 7.x-1.4
Leaflet Widget for Geofield 7.x-2.0-beta1+7-dev (2014-Dec-07)
Comment #15
vegardjo CreditAttribution: vegardjo commented+1, #12 fixed it for me as well
Comment #16
sano CreditAttribution: sano as a volunteer commentedComment #17
fonant CreditAttribution: fonant commented#12 fixed an HTTP 500 error for me on the Edit form of a node with a Leaflet map widget and a multiple field_collection field that needed to use AJAX to update.