django-cms / django-filer

File and Image Management Application for django
https://django-filer.readthedocs.io/
Other
1.73k stars 574 forks source link

JS crash in directory list view of filer #1396

Closed vinitkumar closed 11 months ago

vinitkumar commented 11 months ago
Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
    at window.Actions (actions.js:159:70)
    at HTMLDocument.<anonymous> (actions.js:198:13)
window.Actions @ actions.js:159
(anonymous) @ actions.js:198

This crash is present when trying to load the directory list view. Not sure how to fix this without breaking functionality. @fsbraun Do you have any good ideas for this?

fsbraun commented 11 months ago

@vinitkumar Did you notice any missing functionality?

actions.js is admin's js that is triggered by admin actions ("delete selected xyz") on pressing the "Go" button. Those actions do not exist in the directory listing, or rather are replaced by the button bar and dropdown menu. Hence, the "Go" button does not exist. This throws the error.

Also, it seems actions.js does not update the x of y selected message. (So, this would be one missing functionality.)

fsbraun commented 11 months ago

Upon closer examination, I realize that all functionality of actions.js has been taken over by filer's base.js. So, if we want the "x of y selected" message to work, we need to fix base.js. Really, I do not think actions.js is needed at all. But this would be a refactor of the whole js.