Greetings everyone.
We have noticed a bug with egroupware version 14.3, but it also appears in the current Demo Version
Steps to replicate:
- Open any application, for example InfoLog
- Double click on an entry so the edit screen pops up.
- Copy the link of the edit screen (it’s the same link that’s being sent in emails)
- Open a new tab and paste the link
- Open a new tab and paste the link again
From the second time and on (third, fourth etc.) the index page will appear, and not the edit one.
If you visit home the index page this resets and the first time it appears again.
After a lot of searching, it looks like jdots framework cannot see the actual URL for some reason. I figured this goes deep within the code logic.
A sample solution we implemented (kind of a ‘hack’ really) is inside the fw_base.js file (phpgwapi/js/framework/fw_base.js)
Inside method applicationTabNavigate, there is a check:
if (typeof _url == ‘undefined’ || _url == null)
{
_url = _app.indexUrl;
}
This is where the URL gets replaced with the Index url.
The solution we implemented is to fetch the URL from window.location.href at this point, compare the two URLs and if it’s a match, follow the appropriate method inside the app.
if (typeof _url == ‘undefined’ || _url == null)
{
_url = _app.indexUrl;
// When Loading Edit screen twice, the second time shows Index screen
// URL is sometimes missing and reverting to index instead of actual page
// Get URL from window.location and if it matches replace it
// Using custom function getParameterByName
var menu1 = getParameterByName(‘menuaction’, _url);
var menu2 = getParameterByName(‘menuaction’, window.location.href );
if ( menu1 != null && menu2 != null) {
var parts1 = menu1.split(’.’);
var parts2 = menu2.split(’.’);
if ( parts1[0] == parts2[0] && parts1[1] == parts2[1] ) {
var first = _url.split(’?’);
_url = first[0] + window.location.search + ‘&ajax=true’;
}
}
}
It would be great to see this or a proper solution implemented within the framework.
Thank you in advance.