modxbot / migrate

A testground for migrating issues and other such fun
0 stars 0 forks source link

Serious javascript errors in managers #5831

Open gerritvanaaken opened 12 years ago

gerritvanaaken commented 12 years ago

gerritvanaaken created Redmine issue ID 5831

This one is difficult to reproduce. From time to time, my client cannot use the manager at all. He enters the manager as an super user admin, the navigation gets rendered, also the news/security-feeds, but the page tree does not appear, and he cannot perform any click, not even logout.

Javascript is totally broken then and throws several errors, see below. It’s not the exact same js errors in all browsers, but the problem can occur in several browsers (tested with chrome, safari and firefox)

Sometimes it’s possible to use the manager alright in firefox while it’s broken in chrome and safari. Sometimes it’s the other way round. Sometimes it’s broken in all browsers. There is no real pattern.

Sometimes it helps to clear all sessions (with a working browser), clear the browser caches, delete the cookies, then log in again. Sometimes even this does not help.

The easiest way to get it working again: Deleting all browser prefs (in user library on Mac OS X), effectively using a fresh "out-of-the-box" browser. This helped once, when no other actions helped.

Maybe the problem has to do with several browsers logging in with the same user at the same time. Maybe it’s a cache problem, or even a user permission issue. I can’t tell. But the problem is real, my client gets more and more angry...

Errors from Firefox:

invalid label
{"success":false,"message":"Zugriff ve...ert.","total":0,"data":[],"object":[]}
http://www.schleus-mafo.de/connectors/layout/modx.config.js.php?action=&wctx=mgr (Line 1)

_ is not defined
Ext.onReady(function(){if(MODx.config....modx-browser-view",MODx.browser.View);
http://schleus-mafo.de/manager/assets/modext/modext-min.js?v=213pl (Line 21)

MODx.perm is undefined
Ext.apply(Ext,{isFirebug:(window.conso....changeMenu=MODx.LayoutMgr.changeMenu;
http://schleus-mafo.de/manager/assets/modext/build/sections/welcome-min.js?v=213pl (Line 1)

MODx.user is undefined
MODx.page.Welcome=function(A){A=A||{};...MODx.helpWindow.show(Ext.getBody());};
http://schleus-mafo.de/manager/assets/modext/build/sections/welcome-min.js?v=213pl (Line 1)

gerritvanaaken commented 12 years ago

gerritvanaaken submitted:

New investigation information available:

1) Installing a fresh browser does not help. An all-new installation of Opera leads to the same problem. Currently I use Firefox as working browser to investigate.

2) The internal MODX error log throws the following line after each failed attempt to load a manager page: [2011-10-02 18:27:36](ERROR @ /index.php) Could not find profile for user: (anonymous)

I’ll now try to figure out why the user is "anonymous", although I logged in with my admin user...

gerritvanaaken commented 12 years ago

gerritvanaaken submitted:

I might have hunted the bug down.

I figured out that by simply visiting the login page of the manager ("domain.com/manager/index.php"), the browser gets 2(!) different cookies. One from "domain.com", one from "www.domain.com".

Additionally, I have activated the .htaccess in the root dir, rewriting everything from "domain.com" to "www.domain.com".

Additionally, I also activated the .htaccess in the manager dir, which destroys this Rewriting.

When I deactivate the .htaccess from manager dir, all login problems are gone. The system only writes one cookie (the one for www.domain.com), and it seems like everything is alright.

Now who to blame? :-) Seems like the manager htaccess might be toxic and should not be used. Why is it there? Could we just drop it from the repository?

opengeek commented 12 years ago

opengeek submitted:

You can add the domain redirects to the manager .htaccess if necessary, though it sounds like your server might be always reporting the domain with the www which was causing the issue in the manager wrt to the session cookies.

modxbot commented 12 years ago

jmartsch submitted:

I have the same problems with a fresh install of MODX 2.2.2-pl or version 3.0 from git. Nothing is shown just javascript errors (see screenshot) :(

I am running Ubuntu 11.10 with Apache2 and PHP 5.3.10 on server side. Tested and reproducable with Chrome 18 and Firefox 12.0 on Windows 7 I tried to delete cookies, cache etc. but it doesn´t help. Everytime its the same.

Now i try an install of 2.2.1 or something.

modxbot commented 12 years ago

jmartsch submitted:

Same problem exists with a fresh install of 2.2.1 AND 2.1.5-pl (traditional) Tested on Chrome 19 and Firefox 12 on Windows 7.

Please help and fix this problem.

modxbot commented 12 years ago

jmartsch submitted:

I fixed the problem by uninstalling suhosin and PHP and reinstalling both. I think the problem could be related to suhosin. My actual PHP version: PHP Version 5.3.10-1ubuntu3.2 with Suhosin Patch 0.9.10

modxbot commented 11 years ago

richard.coltman submitted:

I had this problem today, in 2.2.5 and have had this on earlier versions. Not loading the resource tree, and all JavaScript wasn't working. Couldn't clear cache or flush permissions. IE was displaying it's usual not so helpful JavaScript wearning. I cleared the cache via FTP and tried all my other browsers (IE and Chrome) and still no luck. It was clearly a scripting issue so I went into my website's phpMyAdmin and switched the "compress_js" key from 1 to 0. I also did the "compress_css" for good measure. It worked immediately with a refresh of the page. I don't know the implications of not using compression but I will leave it switched off for now.

gadamiak commented 11 years ago

gadamiak submitted:

Have you tried to lower number of JS files being minified? I encountered a similar problem and lowering this to 9 from default 10 did help.