Skip to content

Commit

Permalink
Issue #1449: Fix DynamicFieldName in AJAX Query
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaerter committed Jan 10, 2022
1 parent a0f90a0 commit 013c9ef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions var/httpd/htdocs/js/Core.Agent.DynamicFieldDBSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,16 @@ Core.Agent.DynamicFieldDBSearch = (function(TargetNS) {
/TicketID=(\d+)/.exec(document.URL);
TicketID = RegExp.$1;

var liElemId = $Element.parents().closest('li').attr('id');
var activityDialogID = liElemID.match(/^Process_ActivityDialog-([a-f0-9]{32})$/)[1];

// serialize form
QueryString = Core.AJAX.SerializeForm($('#'+DynamicFieldName).closest('form'), IgnoreList) + SerializeData(UpdateList);

QueryString += ";Action="+FrontendInterface;
QueryString += ";Term="+encodeURIComponent(Request.term);
QueryString += ";MaxResults="+Core.Config.Get('Autocomplete.MaxResultsDisplayed');
QueryString += ";DynamicFieldName="+encodeURIComponent(DynamicFieldName);
QueryString += ";DynamicFieldName="+encodeURIComponent(DynamicFieldName.substring(0, DynamicFieldName.indexOf('_' + activityDialogId)));
QueryString += ";TicketID="+encodeURIComponent(TicketID);

URL = Core.Config.Get('Baselink');
Expand All @@ -276,7 +279,7 @@ Core.Agent.DynamicFieldDBSearch = (function(TargetNS) {
// run the response function to hide the request animation
Response({});
}

$Element.data('AutoCompleteXHR', Core.AJAX.FunctionCall(URL, QueryString, function(Result) {

Data = [];
Expand Down

0 comments on commit 013c9ef

Please sign in to comment.