From 8e8da0ad8f1f4abdab6ffbc581013c0ad8028442 Mon Sep 17 00:00:00 2001 From: colemanw Date: Fri, 4 Aug 2023 08:39:00 -0400 Subject: [PATCH] Fix dev/core#4461 missing links causing SK to return no results --- .../Civi/Api4/Action/SearchDisplay/AbstractRunAction.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php b/ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php index 6c1269f2e1..34438e515f 100644 --- a/ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php +++ b/ext/search_kit/Civi/Api4/Action/SearchDisplay/AbstractRunAction.php @@ -463,8 +463,10 @@ abstract class AbstractRunAction extends \Civi\Api4\Generic\AbstractAction { return NULL; } $link['text'] = $text ?? $this->replaceTokens($link['text'], $data, 'view'); - if ($link['path']) { - $link['url'] = $this->getUrl($this->replaceTokens($link['path'], $data, 'url', $index)); + // Will return null if `$link[path]` is empty or if any tokens do not resolve + $path = $this->replaceTokens($link['path'], $data, 'url', $index); + if ($path) { + $link['url'] = $this->getUrl($path); $keys = ['url', 'text', 'title', 'target', 'style', 'icon']; } else { -- 2.25.1