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

get_all_user_name_fields() deprecated since Moodle 3.11 #247

Open
rmartinezgc opened this issue May 7, 2024 · 1 comment
Open

get_all_user_name_fields() deprecated since Moodle 3.11 #247

rmartinezgc opened this issue May 7, 2024 · 1 comment

Comments

@rmartinezgc
Copy link

Congratulations for your titanic work with this plugin and its maintenance, bravo!

When upgrading my Moodle platform to version 4.3.3+ (Build: 20240409), and with their respective plugins, and with php 8.1, I have realized that with your new version, it does not work in the report that I had created and working in previous versions. Reviewing the code, I have seen that the get_all_user_name_fields() method is still being used when this method is deprecated since Moodle version 3.11. I think your plugin would work if another method was used instead.

Thank you.

Regards.

@top-ender
Copy link

We use this plugin now with Moodle 4.3 and 4.4 and got the same error message when using the user-filters.
For a quick and dirty solution to keep the plugin running we locally changed two lines in components/filters/users:

- $sort = implode(',', order_in_string(get_all_user_name_fields(), $nameformat));
+ $sort = implode(',', order_in_string(\core_user\fields::get_name_fields(), $nameformat));
- $users = $remotedb->get_records_select('user', "id " . $usql, $params, $sort, 'id,' . get_all_user_name_fields(true));
+ $users = $remotedb->get_records_select('user', "id " . $usql, $params, $sort, 'id,' . \core_user\fields::for_name()->get_sql('', true, '', '', false )->selects); 

Maybe this could be a solution for your problem as well and supports the further development of this plugin.

Regards,
Christoph

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

2 participants