Eileen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/240307

Change subject: CRM-17156 do not log user id in unit test context
......................................................................

CRM-17156 do not log user id in unit test context

The first attempt to determine the user ID is before the userSystem is 
determined (in dev instances)
It seems that it would be defined for drupal & if not then we can assume it is 
a UnitTest & skip it

Change-Id: I4ee3a493232d3452ade129f32c72efd022162e80
---
M packages/DB/common.php
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/07/240307/1

diff --git a/packages/DB/common.php b/packages/DB/common.php
index 32b4c8e..18fab27 100644
--- a/packages/DB/common.php
+++ b/packages/DB/common.php
@@ -1161,7 +1161,12 @@
         }
         else {
             global $user;
-            $prefix = "/* https://civicrm.wikimedia.org/user/{$user->uid} */ ";
+            if (empty($user)) {
+                $prefix = 'phpunit-test';
+            }
+            else {
+                $prefix = "/* https://civicrm.wikimedia.org/user/{$user->uid} 
*/ ";
+            }
         }
         $query = $prefix . $query;
 

-- 
To view, visit https://gerrit.wikimedia.org/r/240307
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ee3a493232d3452ade129f32c72efd022162e80
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to