AEM 6.5 core js throws error on dialog open, expects action attribute on .cq-dialog (all.js, line 166)



In line 166 of all.js, there needs to be a check for the action attribute before it tries to get a string match of its value.

This is the existing fragment of code in all.js, line 166:


if (!(0 > c(".coral-Form.cq-dialog").attr("action").indexOf("sticky_menu"))) {


which throws this (blocking) error:


Uncaught TypeError: Cannot read property 'indexOf' of undefined
    at HTMLDocument.<anonymous> (all.js:166)


Instead, the line should check that c(".coral-Form.cq-dialog").attr("action") exists before getting its value, like this:

if (c(".coral-Form.cq-dialog").attr("action") && !(0 > c(".coral-Form.cq-dialog").attr("action").indexOf("sticky_menu"))) {


I'm not sure if this error surfaced based on something we've developed, but there should be a check that the element has an attribute before determining its value.

core cq:dialog dialog javascript UI ux

Accepted Solutions (1)

Accepted Solutions (1)

Answers (0)