Lesterhuis-Training-en-Consultancy / moodle-block_configurable_reports

This block is a Moodle custom reports builder. You can create custom reports without SQL knowledge. It's a tool suitable for admins or teachers.
http://moodle.org/plugins/view.php?plugin=block_configurable_reports
0 stars 0 forks source link

get_all_user_name_fields() deprecated since Moodle 3.11 #5

Open top-ender opened 1 month ago

top-ender commented 1 month ago

Linked form old repo:

https://github.com/jleyva/moodle-block_configurablereports/issues/247


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 support the further development of this plugin.

Regards, Christoph

gemguardian commented 1 week ago

@top-ender thank you for providing this solution. We did the 4.1 update as a collabrated community project, that is been funded by 3 organization. We don't have any funds left to continue fixing issues. Though in this case I am inclided to see if we can implement the suggestion and then push to the orginal developer.

@luukverhoeven is there time within your team to check this solutions? And if so - how much time would you need.

luukverhoeven commented 1 week ago

@gemguardian This approach would work for 4.3 and 4.4. Maybe the best option would be to create new separate 4.3/4.4 releases for it. I don’t think this is backwards compatible with 4.1.

We need 30-60 minutes to implement, test, and deploy it to Moodle.org/GitHub.