Skip to content

Commit 4e39e88

Browse files
authored
Merge pull request #31861 from colemanw/taskLinkFix
SearchKit - Fix error when adding task-based link to field
2 parents 4bc263c + 6bbea5f commit 4e39e88

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/search_kit/ang/crmSearchAdmin/crmSearchAdminDisplay.component.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
return !info.fn || info.fn.category !== 'aggregate' || info.fn.name === 'GROUP_CONCAT';
273273
}
274274

275-
var linkProps = ['path', 'entity', 'action', 'join', 'target'];
275+
const LINK_PROPS = ['path', 'entity', 'action', 'join', 'target', 'task'];
276276

277277
this.toggleLink = function(column) {
278278
if (column.link) {
@@ -286,8 +286,8 @@
286286

287287
this.onChangeLink = function(column, afterLink) {
288288
column.link = column.link || {};
289-
var beforeLink = column.link.action && _.findWhere(ctrl.getLinks(column.key), {action: column.link.action});
290-
if (!afterLink.action && !afterLink.path) {
289+
const beforeLink = column.link.action && _.findWhere(ctrl.getLinks(column.key), {action: column.link.action});
290+
if (!afterLink.action && !afterLink.path && !afterLink.task) {
291291
if (beforeLink && beforeLink.text === column.title) {
292292
delete column.title;
293293
}
@@ -299,7 +299,7 @@
299299
} else if (!afterLink.text && (beforeLink && beforeLink.text === column.title)) {
300300
delete column.title;
301301
}
302-
_.each(linkProps, function(prop) {
302+
LINK_PROPS.forEach((prop) => {
303303
column.link[prop] = afterLink[prop] || '';
304304
});
305305
};

0 commit comments

Comments
 (0)