Menu for Apps


We use the DHIS2 menu in some of our apps

. We noticed that with the 2.30 version it’s not appearing and we get these errors:

GET 500 (Error Interno del Servidor)
GET 500 (Error Interno del Servidor)

The error is because of the double slash, //

Estado HTTP 500 - The request was rejected because the URL was not normalized.

It works in our local instances where the address is http://localhost:8989/dhis but not in our production server where the address has not a base url like “dhis”

I think that part of the problem is in the code of in the dhis2.settings.getBaseUrl() function:

baseUrl = [href, dhis2.settings.baseUrl].join(’/’);

If the dhis2.settings.baseUrl is null, when it makes the join it adds a / and then later in the code it adds another /

var helpPagePromise = jQuery.ajax({
type : “GET”,
url : dhis2.settings.getBaseUrl() + “/dhis-web-commons/menu/getHelpPageLinkModule.action”,
dataType : “json”
var userProfilePromise = jQuery.ajax({
type: “GET”,
url: dhis2.settings.getBaseUrl() + “/api/me/profile.json”,
dataType: “json”

Please, could you review it? Or can we fix it from our side?

Thank you very much, Tomàs.

1 Like