Awight has submitted this change and it was merged.
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: I379e2b3cf3473687ff3b71c5ac4c6a9fcd8c728d
---
M packages/DB/common.php
1 file changed, 6 insertions(+), 1 deletion(-)
Approvals:
Awight: Verified; Looks good to me, approved
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/240953
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I379e2b3cf3473687ff3b71c5ac4c6a9fcd8c728d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: 4.6.9-deploy
Gerrit-Owner: Eileen <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Eileen <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits