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

moosh user-delete uses Moodle39 command for a moodle 4.1 version #450

Open
lposmb opened this issue Sep 20, 2023 · 2 comments
Open

moosh user-delete uses Moodle39 command for a moodle 4.1 version #450

lposmb opened this issue Sep 20, 2023 · 2 comments
Assignees

Comments

@lposmb
Copy link

lposmb commented Sep 20, 2023

  • moosh version: 1.15 commit 145f9d7
  • moodle version: 4.1.5+
    • database: 10.6.12-MariaDB-0ubuntu0.22.04.1-log
  • php version: PHP 8.1.2-1ubuntu2.14
  • operating system: Ubuntu 22.04.3 LTS

Actual behaviour

The following command works but throw deprecated message and show a Command/Moodle39 instead of Moodle41 folder in the trace despite the verbose log line saying "Moodle version detected: 401".

www-data@mdl-appr-dev02:~/moodle/https/moodle-dev$ moosh --verbose user-delete pcoui
Moodle version detected: 401
Top Moodle dir: /var/www/moodle/https/moodle-dev-05
Current working dir: /var/www/moodle/https/moodle-dev-05
Relative Moodle dir: 
Processing command option 'help''
Command: delete (user)
Options:
	help (): ''
Arguments:
	pcoui
++ Class 'format_base' has been renamed for the autoloader and is now deprecated. Please use 'core_courseformat\base' instead. ++
* line 143 of /lib/classes/component.php: call to debugging()
* line 37 of /course/format/collapsibletopics/lib.php: call to core_component::classloader()
* line 877 of /lib/classes/component.php: call to include_once()
* line 7908 of /lib/moodlelib.php: call to core_component::get_plugin_list_with_file()
* line 2452 of /lib/blocklib.php: call to get_plugins_with_function()
* line 2516 of /lib/blocklib.php: call to blocks_delete_instance()
* line 5542 of /lib/accesslib.php: call to blocks_delete_all_for_context()
* line 4247 of /lib/moodlelib.php: call to context->delete_content()
* line 229 of /user/lib.php: call to delete_user()
* line 38 of /var/www/moodle/moosh/Moosh/Command/Moodle39/User/UserDelete.php: call to user_delete_user()
* line 365 of /var/www/moodle/moosh/moosh.php: call to Moosh\Command\Moodle39\User\UserDelete->execute()

Expected behaviour

The same but using the corresponding Moodle API.

Steps to reproduce

  • Deploy moosh with the git clone method
  • System-wide link for $PATH
  • use a git cloned moodle 4.1.5+ using the official moodle repository and MOODLE_401_STABLE branch
  • run the command from above (moosh --verbose user-delete pcoui)

Thanks for all the fish,
Ludovic Pouzenc

@lposmb
Copy link
Author

lposmb commented Sep 20, 2023

Additional information : other command like this one seems broken for me :

www-data@mdl-appr-dev02:~/moodle/https/moodle-dev$ moosh --verbose top
Moodle version detected: 401
$CFG - stdClass Object
(
    [dbtype] => mariadb
    [dblibrary] => native
    [dbhost] => localhost
    <snip>
)
PHP Fatal error:  Method lang_string::__set_state() must take exactly 1 argument in /var/www/moodle/moosh/includes/moodle/lib/moodlelib.php on line 10282
www-data@mdl-appr-dev02:~/moodle/https/moodle-dev$ 

@lposmb lposmb changed the title moosh user-delete users Moodle59 command for a moodle 4.1 version moosh user-delete uses Moodle39 command for a moodle 4.1 version Sep 20, 2023
@tmuras
Copy link
Owner

tmuras commented Aug 27, 2024

Let's create a new version of the user-delete command for Moodle 4.5 (new LTS), so new file /Moosh/Command/Moodle39/User/UserDelete.php.

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

3 participants