Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdminerJsonPreview generates error #8

Open
xyboox opened this issue Nov 11, 2020 · 4 comments
Open

AdminerJsonPreview generates error #8

xyboox opened this issue Nov 11, 2020 · 4 comments

Comments

@xyboox
Copy link

xyboox commented Nov 11, 2020

On one of my servers, when enabling this plugin, the page load is interrupted when viewing data that contains JSON objects. The error I see in chrome console is:

Uncaught TypeError: Cannot read property 'getElementsByTagName' of null at HTMLDocument.init

However, I noticed the error is triggered by line #77 in AdminerTheme.php ( although, I emphasize it only happens when JSON plugin is loaded ).

About env.:
OS: Ubuntu 18.04.5 LTS
Webserver: Apache 2

@peterpp
Copy link
Member

peterpp commented Dec 24, 2020

I can't imagine a way how AdminerJsonPreview plugin can cause this error. This plugin modifies different parts of HTML page. You are referring to this code:

var menu = document.getElementById("menu");
var button = menu.getElementsByTagName("h1")[0];

Variable menu should be defined because element with ID "menu" is part of the core HTML generated by Adminer itself. Are you using any other custom plugins? Do you see <div id="menu"> in HTML code?

@xyboox
Copy link
Author

xyboox commented Jan 9, 2021

Well... here's the thing: I believe is some racing condition here. When using this plugin, the error is thrown before the entire page gets loaded ( so to answer to your question: no, there is no <div id="menu"> in the html code ).

@peterpp
Copy link
Member

peterpp commented Apr 3, 2021

Could you provide more details? What browser do you use, what Adminer page do you open and what plugins do you use?

@xyboox
Copy link
Author

xyboox commented Apr 3, 2021

Sure: using latest Chrome on macOS ( Catalina ), Adminer v4.7.8 with these plugins only:

  1. AdminerJsonPreview
  2. AdminerLoginServers
  3. AdminerTheme

Regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants