Skip to content

[5.0.2] [Moodle 5.1.5] [PHP 8.3] Console error trying to add event listener to non-existing "closebutton" #21

Description

@danowar2k

From the JS console log:

VM830:2 Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
    at <anonymous>:2:45
    at m (jquery-3.7.1.min.js:2:880)
    at $e (jquery-3.7.1.min.js:2:46274)
    at ce.fn.init.append (jquery-3.7.1.min.js:2:47633)
    at Object.runTemplateJS (first.js:1010:461)
    at first.js:6810:468
    at e (jquery-3.7.1.min.js:2:27028)
    at t (jquery-3.7.1.min.js:2:27330)

Looking at the template that is loaded there: https://github.com/grabs/moodle-tool_userdebug/blob/main/templates/debuginfo.mustache

You're looking for #closebutton-{{uniqid}} in there, but you removed the closebutton in the commit: 11f28e0#diff-0e9eb1cbbc938194b3c26f68f50d9ee76718af28c9fbe027b3ed7521c1a0a6a7

Maybe you forgot to also remove or adapt the js in the template?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions