From f3c2d9da50ee321aa0184c9f2a2a261444dfc1a5 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Thu, 13 Oct 2022 15:03:54 -0400 Subject: [PATCH] add code comment about null --- CRM/Core/BAO/Translation.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Core/BAO/Translation.php b/CRM/Core/BAO/Translation.php index 4cc2d96c28ac..61c9007db5fc 100644 --- a/CRM/Core/BAO/Translation.php +++ b/CRM/Core/BAO/Translation.php @@ -223,6 +223,10 @@ protected static function getTranslatedFieldsForRequest(AbstractAction $apiReque // and prefer, for example, French French over US English for French Canadians. // Sites that genuinely want to cater to both will add translations for both // and we work through preferences below. + // @todo: Some scripts/unit tests don't set a language so nominal is null, + // so this then ends up retrieving all languages and then just picking + // one. Should it treat null in a better way? Should it be an explicit + // error not to have a language set? $translations->addWhere('language', 'LIKE', substr($userLocale->nominal ?? '', 0, 2) . '%'); } else {