Needs review
Project:
User titles
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Sep 2011 at 08:18 UTC
Updated:
28 Sep 2011 at 08:18 UTC
Changes to points will not result in levels being changed.
The problem is that $params->uid is used where $params['uid'] should be used.
Here is a diff, with some paramter checking and watchdog message to help tracing.
diff --git a/contrib/ut_userpoints/ut_userpoints.module b/contrib/ut_userpoints/ut_userpoints.module
index 9934972..f44d839 100644
--- a/contrib/ut_userpoints/ut_userpoints.module
+++ b/contrib/ut_userpoints/ut_userpoints.module
@@ -15,7 +15,13 @@ function ut_userpoints_userpoints($op, $params = array()) {
if (variable_get('user_titles_hook_module', 'ut_basic') == 'ut_userpoints') {
switch ($op) {
case 'points after':
- user_titles_set_user_title($params->uid);
+ if ($params['uid'] >0) {
+ //watchdog('ut_userpoints', 'points after: call user_titles_set_user_title for uid ' . $params['ui
+ user_titles_set_user_title($params['uid']);
+ }
+ else {
+ //watchdog('ut_userpoints', 'points after: params[uid] invalid');
+ }
break;
}
}