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.

CommentFileSizeAuthor
inline-forms-fix.patch421 bytesgun_dose

Comments

gun_dose created an issue. See original summary.

kala4ek’s picture

Assigned: Unassigned » kala4ek

  • kala4ek committed 30b1b6d on 8.x-1.x authored by gun_dose
    Issue #3060189 by gun_dose, kala4ek: Widget does not works with inline...
kala4ek’s picture

Assigned: kala4ek » Unassigned
Status: Needs review » Fixed

I'm not sure that it as a good solution, but let keep it until we have a good one.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.