Problem/Motivation
When placing a portlet, I get the following JS error and the portlets won't save:
Uncaught TypeError: domElement is undefined
Which seems to be caused by the "closeDialog" call from "homeboxPortletAdd".
This is where it's getting called:
https://git.drupalcode.org/issue/homebox-3464735/-/blob/3464735-uncaught...
but suddenly stopped working, maybe due to Drupal Core update?
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork homebox-3464735
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anybodyComment #3
anybodyOkay the reason seems to be that in
Drupal.dialog(document.getElementById('drupal-off-canvas')).close();the
document.getElementById('drupal-off-canvas')part returns null.
Because
#drupal-off-canvasid is missing on the off canvas element!But even in 11.x it still seems to be present, so must be something specific to the project or homebox!
https://git.drupalcode.org/search?group_id=2&nav_source=navbar&page=3&pr...
Comment #4
anybody@thomas.frobieter we'll need to take a look tomorrow, the functionality is entirely broken due to this.
Comment #5
anybodyOkay this is definitely an incompatibility with Drupal 10.3.x! Downgrading to 10.2.5 brings functionality (and ID) back!
The ID was never existing, the close call seems to have worked without an ID before Drupal 10.3.x.
We'll simply remove the line with the
close()call, as the page will reload anyway. If we'll ever need it again, we should simply add our custom ID on the dialog wrapper, as it never had the#drupal-off-canvasID, not even in 10.2.5 where it was working.Removed the affected line as the page reloads anyway after adding a portlet.
Comment #7
anybodyComment #9
anybodyComment #11
anybody