Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"user_picture::fields() is deprecated, in line 885 of lib.php #609

Open
drachels opened this issue Oct 3, 2024 · 0 comments
Open

"user_picture::fields() is deprecated, in line 885 of lib.php #609

drachels opened this issue Oct 3, 2024 · 0 comments

Comments

@drachels
Copy link

drachels commented Oct 3, 2024

Was just doing some work on the Diary plugin for recent activity, when I go the following error regarding Questionnaire 4.1.1 (Build - 2024082900):

Whoops\Exception\ErrorException thrown with message "user_picture::fields() is deprecated. Please use the \core_user\fields API instead."

Stacktrace:
#2 debugging in /var/www/moodledev/lib/outputcomponents.php:257
#1 user_picture:fields in /var/www/moodledev/mod/questionnaire/lib.php:885
#0 questionnaire_get_recent_mod_activity in /var/www/moodledev/course/recent.php:167

I tried the following which seems to fix the error:
//$ufields = user_picture::fields('u', null, 'useridagain');
$userfieldsapi = \core_user\fields::for_userpic();
$ufields = $userfieldsapi->get_sql('u', false, '', 'useridagain', false)->selects;;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant