Eileen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/240953
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(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm
refs/changes/53/240953/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/240953
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I379e2b3cf3473687ff3b71c5ac4c6a9fcd8c728d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: 4.6.9-deploy
Gerrit-Owner: Eileen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits