Skip to content

Commit

Permalink
replaced base_url by location.origin+pathname due to htmx-issue in si…
Browse files Browse the repository at this point in the history
…temap
  • Loading branch information
zmsdev committed Feb 10, 2025
1 parent 25bc248 commit a4e2e1b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
16 changes: 4 additions & 12 deletions Products/zms/plugins/www/ZMS/zmi_body_content_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,13 @@ function zmiBodyContentSearch(q,pageSize,pageIndex) {
fq.push('home_id_s:'+zmiParams['home_id']);
}
p['fq'] = fq;
var baseurl = $('meta[name=physical_path]').attr('content');
if (typeof baseurl == "undefined") {
try {
baseurl = zmiParams['base_url'];
} catch(e) {
console.log(e);
baseurl = window.location['pathname'];
}
}
if (baseurl.indexOf("/content")>0) {
baseurl = baseurl.substring(0,baseurl.indexOf("/content")+"/content".length);
var base_url = self.location.origin + self.location.pathname;
if (base_url.indexOf("/content")>0) {
base_url = base_url.substring(0,base_url.indexOf("/content")+"/content".length);
}
var adapter = $ZMI.getConfProperty('zms.search.adapter.id','zcatalog_adapter');
var connector = $ZMI.getConfProperty('zms.search.connector.id','zcatalog_connector');
var url = baseurl+'/'+adapter+'/'+connector+'/search_json';
var url = base_url+'/'+adapter+'/'+connector+'/search_json';
$.ajax({
url:url,
data:p,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,7 @@ ZMIActionList.prototype.over = function(el, e, cb) {
action += context_id+"/manage_main";
}
action += "?lang=" + lang;
// TODO: navigate to href with htmx
self.location.href = action;
}
else {
Expand All @@ -1477,7 +1478,7 @@ ZMIActionList.prototype.over = function(el, e, cb) {
return false;
});
// Build action and params.
var action = zmiParams['base_url'];
var action = self.location.origin + self.location.pathname;
action = action.substring(0,action.lastIndexOf("/"));
action += "/manage_ajaxZMIActions";
var params = {};
Expand Down
1 change: 0 additions & 1 deletion Products/zms/plugins/www/zmi.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ $ZMI.registerReady(function(){
}
}
}
zmiParams['base_url'] = base_url;

// Content-Editable ////////////////////////////////////////////////////////
if ( self.location.href.indexOf('/manage')>0 || self.location.href.indexOf('preview=preview')>0 ) {
Expand Down
2 changes: 1 addition & 1 deletion Products/zms/zpt/ZMS/manage_users.zpt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function zmiModalInsertUserLoad(url) {
$(this).parents(".ZMSRecordSet.main_grid").css({overflow:"visible"});
});
$("#zmiModalinsertUser #insertUserForm input:radio").change(function() {
self.location.href = zmiParams['base_url']
self.location.href = self.location.origin + self.location.pathname
+'?lang='+getZMILang()
+'&id='+$(this).prop("value");
});
Expand Down

0 comments on commit a4e2e1b

Please sign in to comment.