Expand my Community achievements bar.

SOLVED

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

Avatar

Level 1

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.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Can you log a daycare ticket with steps to reproduce the issue on a plain AEM instance and we can check internally.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

Can you log a daycare ticket with steps to reproduce the issue on a plain AEM instance and we can check internally.