Closed (fixed)
Project:
Yandex.Maps
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Jun 2019 at 10:13 UTC
Updated:
1 Jul 2019 at 15:49 UTC
Jump to comment: Most recent
When field with map belongs to nested entity and inline form is closed by default, then map does not appear, when inline form is loaded. There are errors in browser console Uncaught ReferenceError: ymaps is not defined.
I found reason of this bug: yandex maps api loaded slower than module scripts, so when module scripts executed, yandex API is not loaded yet. But in Drupal ecosystem it is very difficult to determine if external script loaded or not, so I propose simple solution: just check if ymaps defined or not, and if it isn't, just set timeout and attach behaviours again.
In yamaps.init.js
if (typeof ymaps === 'undefined') {
setTimeout(Drupal.attachBehaviors, 200);
return;
}
It works good for me. And patch with this fix is attached.
| Comment | File | Size | Author |
|---|---|---|---|
| inline-forms-fix.patch | 421 bytes | gun_dose |
Comments
Comment #2
kala4ekComment #4
kala4ekI'm not sure that it as a good solution, but let keep it until we have a good one.