When the field is used inside of a closed Paragraph (https://www.drupal.org/project/paragraphs), the map isn't being rendered when creating a new or editing an existing Paragraph.
Steps to reproduce:
1. Download and install both Paragraphs (https://www.drupal.org/project/paragraphs) and Geolocation.
2. Create a new paragraph bundle and add a geolocation field to it (use any of the google maps widgets).
3. Add a paragraphs field to any content type and activate the bundle we created in step 2.
4. Create new page and add a new paragraph.
Expected result:
New Paragraph appears with Google Map being shown.
Actual result:
In case of Google Map widget it dies with js error "Uncaught ReferenceError: google is not defined". In case of Google Map D8 widget the Paragraph appears without the Map.
Comment | File | Size | Author |
---|---|---|---|
#19 | interdiff_18-19.txt | 472 bytes | CRZDEV |
#19 | geolocation-google-map-closed-paragraphs-2619140-19-7.x.patch | 4.14 KB | CRZDEV |
#15 | geolocation_d7_paragraphcompatibility-2619140-15.patch | 14.92 KB | shawngo |
#2 | geolocation_googlemaps-paragraphcompatibility-2619140-1-7.x.patch | 12.72 KB | quiron |
Comments
Comment #2
quironI have the same problem, and I soved it with using $.ajax complete control. The patch is working for me.
Anyone can test please?
Comment #3
derjochenmeyer CreditAttribution: derjochenmeyer at forward-media.de commentedComment #5
RgnYLDZ CreditAttribution: RgnYLDZ commentedI don't know if this is related but I'm using views megarow that displays the node content. The node content has a dynamic map field as display.
Because the megarow is loaded on a click event manually, the google libraries are not loaded I think. So the first megarow content gives the "Uncaught ReferenceError: google is not defined" error.
The second megarow I click displays the content and the map without any problem.
Maby an approach like "Load libraries on every page" would solve this quickly, like the colorbox module.
Comment #6
derjochenmeyer CreditAttribution: derjochenmeyer at forward-media.de commentedDid anyone test this patch?
Comment #8
rcodina CreditAttribution: rcodina commentedSimilar problems with Inline Entity From. Same error:
Uncaught ReferenceError: google is not defined
The patch doens't work for me (for Inline Entity Form).
Comment #9
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commentedUnless proven otherwise, this is assumed fixed by #2689921
Please test if issue still relevant.
Comment #10
RgnYLDZ CreditAttribution: RgnYLDZ commentedThis issue is about D7.
Also the patch did not work for me. Still the first opening megarow table is not loading the map, the second one is.
Comment #11
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commented@RgnYLDZ,
sorry, I assumed D8.
Comment #12
GiorgosKSame problem with dynamically loaded entity (which includes geolocation field map widget)
when using https://www.drupal.org/project/views_infinite_scroll
is there a way to call the map initilization on ajax.complete ?
Comment #13
GiorgosKTried
but it does not work
anything else I could try ?
Comment #14
Bensbury CreditAttribution: Bensbury as a volunteer commentedI couldn't apply the patch either.
error: patch failed: modules/geolocation_googlemaps/geolocation_googlemaps_widget.js:186
error: modules/geolocation_googlemaps/geolocation_googlemaps_widget.js: patch does not apply
Shame if it actually fixes the problem.
Comment #15
shawngo CreditAttribution: shawngo commentedI applied the patch manually and exported a new patch which applied cleanly to the latest dev. The patch also removes extra spacing and a couple coding standards issues.
The patch fixed the issue when loading the Google Map widget on a paragraph field.
Comment #16
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commentedHey,
how is this distinct from https://www.drupal.org/node/1277888?
Comment #17
tko CreditAttribution: tko commentedPatch from #15 fixed the problem.
But you're unable to add more than 1 paragraph which includes a map. The admin UI is blank for the second map. I suppose this is a separate issue?
Comment #18
CRZDEV CreditAttribution: CRZDEV as a volunteer and at Metadrop commentedNew patch to solve this problem, i realised that id was equal in all cases so here goes a new patch to solve that.
And also load google maps and execute callback function if required to prevent js exception: https://developers.google.com/maps/documentation/javascript/tutorial
This patch should work even with multiple and nested paragraphs. Please review.
Comment #19
CRZDEV CreditAttribution: CRZDEV at Metadrop commentedNew patch to also allow multiple values.
Comment #20
unstatu CreditAttribution: unstatu commented#19 works for me :) Thanks!
Comment #21
ChristianAdamski CreditAttribution: ChristianAdamski as a volunteer commentedClosing all 7.x issues. It's time.