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

Errors from group-memberadd #443

Open
mtkraai opened this issue Jul 7, 2023 · 0 comments
Open

Errors from group-memberadd #443

mtkraai opened this issue Jul 7, 2023 · 0 comments

Comments

@mtkraai
Copy link

mtkraai commented Jul 7, 2023

  • moosh version: 1.11
  • moodle version: 4.1.3 (Build: 20230424)
    • database: mariadbd Ver 10.11.2-MariaDB (from MariaDB official repo)
  • php version: PHP 7.4.33 (from remi repo)
  • operating system: RHEL 7.9

Actual behaviour

When adding a user to a group with userid:

$ sudo -u apache moosh group-memberadd -c "95" -g "260" "24268"
++ user_get_participants() is deprecated. Please use \core\table\participants_search::class with table filtersets instead. ++
* line 3182 of /lib/deprecatedlib.php: call to debugging()
* line 44 of /opt/moosh/Moosh/Command/Moodle39/Group/GroupMemberadd.php: call to user_get_participants()
* line 365 of /opt/moosh/moosh.php: call to Moosh\Command\Moodle39\Group\GroupMemberadd->execute()
++ user_get_participants_sql() is deprecated. Please use \core\table\participants_search::class with table filtersets instead. ++
* line 2944 of /lib/deprecatedlib.php: call to debugging()
* line 3185 of /lib/deprecatedlib.php: call to user_get_participants_sql()
* line 44 of /opt/moosh/Moosh/Command/Moodle39/Group/GroupMemberadd.php: call to user_get_participants()
* line 365 of /opt/moosh/moosh.php: call to Moosh\Command\Moodle39\Group\GroupMemberadd->execute()

Notice: Undefined offset: 24268 in /opt/moosh/Moosh/Command/Moodle39/Group/GroupMemberadd.php on line 58
Default exception handler: Invalid user Debug: SELECT * FROM {user} WHERE id IS NULL
[array (
)]
Error code: invaliduser
* line 1654 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
* line 1630 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
* line 52 of /group/lib.php: call to moodle_database->get_record()
* line 59 of /opt/moosh/Moosh/Command/Moodle39/Group/GroupMemberadd.php: call to groups_add_member()
* line 365 of /opt/moosh/moosh.php: call to Moosh\Command\Moodle39\Group\GroupMemberadd->execute()

!!! Invalid user !!!

When adding a user to a group with username:

$ sudo -u apache moosh group-memberadd -c "95" -g "260" "email@example.com"
++ user_get_participants() is deprecated. Please use \core\table\participants_search::class with table filtersets instead. ++
* line 3182 of /lib/deprecatedlib.php: call to debugging()
* line 44 of /opt/moosh/Moosh/Command/Moodle39/Group/GroupMemberadd.php: call to user_get_participants()
* line 365 of /opt/moosh/moosh.php: call to Moosh\Command\Moodle39\Group\GroupMemberadd->execute()
++ user_get_participants_sql() is deprecated. Please use \core\table\participants_search::class with table filtersets instead. ++
* line 2944 of /lib/deprecatedlib.php: call to debugging()
* line 3185 of /lib/deprecatedlib.php: call to user_get_participants_sql()
* line 44 of /opt/moosh/Moosh/Command/Moodle39/Group/GroupMemberadd.php: call to user_get_participants()
* line 365 of /opt/moosh/moosh.php: call to Moosh\Command\Moodle39\Group\GroupMemberadd->execute()

Notice: Undefined index: email@example.com in /opt/moosh/Moosh/Command/Moodle39/Group/GroupMemberadd.php on line 58
Default exception handler: Invalid user Debug: SELECT * FROM {user} WHERE id IS NULL
[array (
)]
Error code: invaliduser
* line 1654 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
* line 1630 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
* line 52 of /group/lib.php: call to moodle_database->get_record()
* line 59 of /opt/moosh/Moosh/Command/Moodle39/Group/GroupMemberadd.php: call to groups_add_member()
* line 365 of /opt/moosh/moosh.php: call to Moosh\Command\Moodle39\Group\GroupMemberadd->execute()

!!! Invalid user !!!

Expected behaviour

User is added to group without errors.

Steps to reproduce

What I did was:

  1. Add a user with user-create (username and email are the same). Note the new userid.
  2. Look up the courseid with course-list.
  3. Look up the groupid with group-list.
  4. Enroll the user in the course with course-enrol.
  5. Add the user to the group with group-memberadd.

The commands from my Bash history (some values changed for privacy):

sudo -u apache moosh user-create --email email@example.com --city Ourtown --country US --firstname Joe --lastname Smith email@example.com
sudo -u apache moosh course-list -o tab -f id,shortname "shortname = \"CTTS Onboarding-00\""
sudo -u apache moosh group-list 95 | grep "NorthDistrict" | uniq | awk '/^\tgroup / {print $2}'
sudo -u apache moosh course-enrol -s 'Onboarding-00' email@example.com
sudo -u apache moosh group-memberadd -c "95" -g "260" "24268"
sudo -u apache moosh group-memberadd -c "95" -g "260" "email@example.com"
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