getgrav / getgrav/grav-plugin-admin

Dropdown add modals not working, JS error

Open
#2,259 6 comments 4 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
377
Forks
225
Avg merge
11h 51m
Merged PRs (30d)
4

Description

Similar to #2132 , putting any add modal in the dropdown does nothing in the UI and generates the following JS error in the console:

`Uncaught TypeError: can't access property "open", $[PLUGIN_NAME].lookup[$target.data(...)] is undefined`

However, note also:

* with `show_in: bar`, the problem never happens (but the button isn't visible in all contexts, so not a great workaround)
* the error only happens in the context of editing pages, not in the pages navigator
* it's _any_ add modal, for adding modules _or_ pages (unlike #2132).

Firefox browser. Latest Admin and Grav core. Cheers.

Contributor guide

Open the contributing guide

Research direction

Reproduce the error in Firefox while editing pages, using an add modal in a dropdown, and compare it with the working `show_in: bar` case and the pages navigator. Trace the undefined `lookup[$target.data(...)]` entry from the dropdown modal JavaScript; done means module and page add modals open without the console error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.