当将 Pressflow 添加到我们的 Drupal 安装时,突然出现此错误。它来自一个自定义模块,在 Pressflow 之前似乎可以正常工作。添加 Pressflow 后,运行 Drush 会导致此错误显示在屏幕上。
被识别为错误源的函数如下所示:
function user_search_location_get(&$user) {
if (count($user->user_location_pref)) { // This line is causing the error.
return $user->user_location_pref;
}
// …
}
错误消息如下:
WD php:注意:未定义的属性:stdClass::$user_location_pref in user_search_location_get()