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

Command icon 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

Anybody created an issue. See original summary.

anybody’s picture

Issue summary: View changes
anybody’s picture

Okay 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-canvas id 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...

anybody’s picture

Assigned: anybody » thomas.frobieter
Priority: Normal » Major

@thomas.frobieter we'll need to take a look tomorrow, the functionality is entirely broken due to this.

anybody’s picture

Assigned: thomas.frobieter » anybody

Okay 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-canvas ID, not even in 10.2.5 where it was working.

Removed the affected line as the page reloads anyway after adding a portlet.

anybody’s picture

anybody’s picture

Assigned: anybody » Unassigned
Status: Active » Reviewed & tested by the community

  • Anybody committed 4fc04a4e on 3.0.x
    Issue #3464735 by Anybody, thomas.frobieter: Uncaught TypeError:...
anybody’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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