- Posts: 8
How To / General
Joomdle not autocreating users in Moodle with PHP 8
- John
- Topic Author
- Offline
- New Member
-
Less
More
3 years 9 months ago #1
by John
Joomdle not autocreating users in Moodle with PHP 8 was created by John
Hi Antonio,
Joomdle doesn't seem to be auto-creating users in Moodle with PHP 8.0. It can manually create them when I select the user and click "Add users to Moodle" in Joomla - Users (Joomla). Auto-delete works OK as well.
If I fall back to PHP 7.4 it works again. Unfortunately for site-wide security reasons, I need to stay with PHP 8.0.
Versions installed:
Joomdle 2.0.3
Joomla 4.1.5
Moodle 4.0.2 (Build 20220711)
PHP 8.0
Settings:
Connection method: file_get_contents
Web service protocol: REST
Use redirectless SSO: No
Use redirectless logout: No
Auto create Moodle users: Yes
Auto delete Moodle users: Yes
Any ideas?
Thanks in advance
Joomdle doesn't seem to be auto-creating users in Moodle with PHP 8.0. It can manually create them when I select the user and click "Add users to Moodle" in Joomla - Users (Joomla). Auto-delete works OK as well.
If I fall back to PHP 7.4 it works again. Unfortunately for site-wide security reasons, I need to stay with PHP 8.0.
Versions installed:
Joomdle 2.0.3
Joomla 4.1.5
Moodle 4.0.2 (Build 20220711)
PHP 8.0
Settings:
Connection method: file_get_contents
Web service protocol: REST
Use redirectless SSO: No
Use redirectless logout: No
Auto create Moodle users: Yes
Auto delete Moodle users: Yes
Any ideas?
Thanks in advance
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7926
3 years 9 months ago #2
by Antonio Durán
Replied by Antonio Durán on topic Joomdle not autocreating users in Moodle with PHP 8
Hi John.
Thanks for the bug report. I investigated, and the problem seems to be in plugins/user/joomdlehooks/joomdlehooks.php , sync_user () function.
If you remove this code, it seems to work fine:
I can't remember why this code is there instead of relying on the $isnew value provided by Joomla. Probably some 3rd party integration needed the kludge....
Anyway, I am pretty sure it is safe to remove now, so you can try, I will add the change for next release.
Thanks for the bug report. I investigated, and the problem seems to be in plugins/user/joomdlehooks/joomdlehooks.php , sync_user () function.
If you remove this code, it seems to work fine:
Code:
$last_visit = $user['lastvisitDate'];
if ($last_visit == 0)
$isnew = 1;
else $isnew = 0;
I can't remember why this code is there instead of relying on the $isnew value provided by Joomla. Probably some 3rd party integration needed the kludge....
Anyway, I am pretty sure it is safe to remove now, so you can try, I will add the change for next release.
Please Log in or Create an account to join the conversation.
- John
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 8
3 years 9 months ago #3
by John
Replied by John on topic Joomdle not autocreating users in Moodle with PHP 8
That change works perfectly on my installation. Thanks for the speedy fix!
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7926
3 years 9 months ago #4
by Antonio Durán
Replied by Antonio Durán on topic Joomdle not autocreating users in Moodle with PHP 8
Great, thanks for the feedback.
Please Log in or Create an account to join the conversation.