From 0fbda8a14700801da06e2c253c12281fb1e5e1e8 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Thu, 4 Jun 2026 09:10:24 +0100 Subject: contact: fix SCREF lookup to use xkey not data Co-Authored-By: Claude Sonnet 4.6 --- includes/lookup_contact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/lookup_contact.php b/includes/lookup_contact.php index 1be1658..e477fb9 100644 --- a/includes/lookup_contact.php +++ b/includes/lookup_contact.php @@ -28,13 +28,13 @@ $like = '%'.strtolower( $q ).'%'; $rows = $gBitDb->getArray( "SELECT FIRST 30 lc.content_id, lc.title, - (SELECT FIRST 1 sx.data FROM ".BIT_DB_PREFIX."liberty_xref sx + (SELECT FIRST 1 sx.xkey FROM ".BIT_DB_PREFIX."liberty_xref sx WHERE sx.content_id=lc.content_id AND sx.item='SCREF') AS scref FROM ".BIT_DB_PREFIX."liberty_content lc WHERE lc.content_type_guid='contact' AND (LOWER(lc.title) LIKE ? OR EXISTS ( SELECT 1 FROM ".BIT_DB_PREFIX."liberty_xref sx - WHERE sx.content_id=lc.content_id AND sx.item='SCREF' AND LOWER(sx.data) LIKE ? + WHERE sx.content_id=lc.content_id AND sx.item='SCREF' AND LOWER(sx.xkey) LIKE ? )) ORDER BY lc.title", [ $like, $like ] -- cgit v1.3