From 8424e75907b2631de017cf012c724de7a68af7ab Mon Sep 17 00:00:00 2001 From: William Desportes Date: Mon, 24 Oct 2022 13:13:12 +0200 Subject: [PATCH] Fix "Link not found!" on foreign columns It also generated invalid queries with no column name to select. Signed-off-by: William Desportes --- libraries/classes/Display/Results.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/classes/Display/Results.php b/libraries/classes/Display/Results.php index 4ac067539a..f9e14af4e1 100644 --- a/libraries/classes/Display/Results.php +++ b/libraries/classes/Display/Results.php @@ -4416,7 +4416,10 @@ class Results $relation = $map[$meta->name]; // Field to display from the foreign table? $dispval = ''; - if ($relation[2] !== '') { + + // Check that we have a valid column name + // Relation::getDisplayField() returns false by default + if ($relation[2] !== '' && $relation[2] !== false) { $dispval = $this->getFromForeign($relation, $whereComparison); }