This topic is locked
[SOLVED]

 Dashboard problem

7/6/2020 5:43:31 AM
PHPRunner General questions
G
gtothill author

Hi all,
I am seeing an error when I try and run a dashboard hosted on NGINX, but interestingly not when I use PHPrunners own built in web server as I develop.
The dashboard won't load and I get the following error in the console. I would have thought that the dashboard code would take care of the naming of dom elements but there may be something that I have done to cause this problem.
The link doesn't provide any further information I'm afraid.
dashboard_dashboard.php:1 [DOM] Found 3 elements with non-unique id #dashelement: (More info: https://goo.gl/9p2vKq)

<input id=​"dashelement" name=​"dashelement" type=​"hidden" value=​"facilities_search">​

<input id=​"dashelement" name=​"dashelement" type=​"hidden" value=​"facilities_map">​

<input id=​"dashelement" name=​"dashelement" type=​"hidden" value=​"facilities_record">​
Has anyone else seen this error and how might I best try and resolve it?
Regards,
Geoff.

Admin 7/6/2020

This is not an error, this is a warning and it won't affect the functionality of the dashboard.
What exactly happens when you load the dashboard on your server?

G
gtothill author 7/6/2020



This is not an error, this is a warning and it won't affect the functionality of the dashboard.
What exactly happens when you load the dashboard on your server?


Hi Sergey,
None of the components of the dashboard display - although they do if I view the dashboard locally.
Thoughts?
Thanks,
Geoff

Admin 7/6/2020

There must be some in PHP error log, check that.
Also, check if those dashboard elements can be loaded as standalone pages.

G
gtothill author 7/6/2020



There must be some in PHP error log, check that.
Also, check if those dashboard elements can be loaded as standalone pages.


Ah ha! Thanks for the steer. I also get this if I dig further -
dashboard_global_dashboard.php:1 Refused to display 'http://netmanager.digitalrivet.local/facilities_list.php'; in a frame because it set 'X-Frame-Options' to 'deny'.
then
loadfirst.js?35002:1 Uncaught DOMException: Blocked a frame with origin "http://netmanager.digitalrivet.local"; from accessing a cross-origin frame.

at contents (http://netmanager.digitalrivet.local/include/loadfirst.js?35002:1:26589)

at Function.map (http://netmanager.digitalrivet.local/include/loadfirst.js?35002:1:3776)

at n.fn.init.n.fn.<computed> [as contents] (http://netmanager.digitalrivet.local/include/loadfirst.js?35002:1:26669)

at HTMLIFrameElement.<anonymous> (http://netmanager.digitalrivet.local/include/runnerJS/RunnerAll.js?35002:2646:238)

at HTMLIFrameElement.dispatch (http://netmanager.digitalrivet.local/include/loadfirst.js?35002:1:40407)

at HTMLIFrameElement.r.handle (http://netmanager.digitalrivet.local/include/loadfirst.js?35002:1:37108)
So it looks like a cross origin restriction - but I don't see why that would be triggered here?
Regards,
Geoff.

G
gtothill author 7/6/2020

Sergey,
I think I may have solved it - I think enabling CORS support on the local test server should solve the problem.
I'm not entirely clear why this should be necessary in this case so if you can shed any light on that particular question it would be appreciated.
Kind regards,
Geoff.

G
gtothill author 7/6/2020

Just in case anyone is mislead by this thread - the failure to display the dashboard was purely a local issue on my dev server.
I am developing on a Nginx server on a docker host running behind a traefik reverse proxy. What appears to have been happening is that traefik was setting X-Frame-Options=DENY which stopped browsers from loading frame content even if it was being requested by a page on the same domain. Allowing custom frame options X-Frame-Options=SAMEORIGIN in the docker traefik config solved the problem. Sorry to have cluttered up the forum with what is I fear a rather parochial problem. (here is a good description of this issue in case it helps anyone else - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options ).