- Posts: 2
How To / General
Coding error detected - Invalid context id
- Dipender Singh
- Topic Author
- Offline
- New Member
-
Less
More
10 years 6 months ago #1
by Dipender Singh
Coding error detected - Invalid context id was created by Dipender Singh
I am facing "Coding error detected issue" when deleting any user from Joomla website. After some research I found that this is calling from Moodle. I have tried with upgraded version 2.6 stable version but same result. The issue is....
Coding error detected, it must be fixed by a programmer
Invalid context id specified context::instance_by_id()
While debugging it is showing these errors:
Debug info:
Error code: codingerror
Stack trace:
line 5130 of \lib\accesslib.php: coding_exception thrown
line 1745 of \lib\accesslib.php: call to context::instance_by_id()
line 4040 of \lib\moodlelib.php: call to role_unassign_all()
line 80 of \admin\user.php: call to delete_user()
Please suggest any option to get rid of this issue.
Thanks
Dipender
Coding error detected, it must be fixed by a programmer
Invalid context id specified context::instance_by_id()
While debugging it is showing these errors:
Debug info:
Error code: codingerror
Stack trace:
line 5130 of \lib\accesslib.php: coding_exception thrown
line 1745 of \lib\accesslib.php: call to context::instance_by_id()
line 4040 of \lib\moodlelib.php: call to role_unassign_all()
line 80 of \admin\user.php: call to delete_user()
Please suggest any option to get rid of this issue.
Thanks
Dipender
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7848
10 years 6 months ago #2
by Antonio Durán
Replied by Antonio Durán on topic Coding error detected - Invalid context id
Hi.
I have never seen thar problem when deleting users, so I don't know why it is coming up, or if is directly related to Joomdle.
Can you test deleting a user directly in Moodle to see if that works fine?
I have never seen thar problem when deleting users, so I don't know why it is coming up, or if is directly related to Joomdle.
Can you test deleting a user directly in Moodle to see if that works fine?
Please Log in or Create an account to join the conversation.
- Dipender Singh
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 2
10 years 6 months ago #3
by Dipender Singh
Replied by Dipender Singh on topic Coding error detected - Invalid context id
Hi Antonio,
Yes you are right its not an issue of joomdle. I have tried to delete users from moodle directly and getting these errors from Moodle. I have also tried to add or delete new user from moodle directly and this is working fine. But seems that its causing issue for those users which have some data or any assigned courses. I have updated the Moodle as well but no result.
I have also tried to delete users from moodle and migrate again using Joomdle > user plugin option and vice-versa. Both time its working fine. But in this case I have lost old user data and moodle report.
Could you please suggest and help.
Thanks
Dipender Singh
Yes you are right its not an issue of joomdle. I have tried to delete users from moodle directly and getting these errors from Moodle. I have also tried to add or delete new user from moodle directly and this is working fine. But seems that its causing issue for those users which have some data or any assigned courses. I have updated the Moodle as well but no result.
I have also tried to delete users from moodle and migrate again using Joomdle > user plugin option and vice-versa. Both time its working fine. But in this case I have lost old user data and moodle report.
Could you please suggest and help.
Thanks
Dipender Singh
Please Log in or Create an account to join the conversation.
- Chris
-
- Offline
- Moderator
-
10 years 6 months ago - 10 years 6 months ago #4
by Chris
Replied by Chris on topic Coding error detected - Invalid context id
Hi there,
Summarizing:
- you say it is not an issue with Joomdle, therefore, a Moodle issue
- adding and deleting directly from moodle is OK
- problem is happening when student / user has data and/or courses assigned
The issue as you have rightly said, seems to indicate an error on the Moodle side. Perhaps not the code but Moodle configuration or permissions. Looking at the last two error messages
line 4040 of \lib\moodlelib.php: call to role_unassign_all()
line 80 of \admin\user.php: call to delete_user()
This would suggest that Moodle is trying to delete the student but not able to for some reason - perhaps invalid data, permissions or configuration.
You may wish to post in the Moodle forums as well as they are likely to have more experience with that code base.
Summarizing:
- you say it is not an issue with Joomdle, therefore, a Moodle issue
- adding and deleting directly from moodle is OK
- problem is happening when student / user has data and/or courses assigned
- Have you compared the user record for those created in Moodle vs those created through Joomdle?
- Have you created a user in Moodle, added them to courses and created data, then deleted the student/user without deleting any data first?
- Have you installed any Moodle plugins?
The issue as you have rightly said, seems to indicate an error on the Moodle side. Perhaps not the code but Moodle configuration or permissions. Looking at the last two error messages
line 4040 of \lib\moodlelib.php: call to role_unassign_all()
line 80 of \admin\user.php: call to delete_user()
This would suggest that Moodle is trying to delete the student but not able to for some reason - perhaps invalid data, permissions or configuration.
You may wish to post in the Moodle forums as well as they are likely to have more experience with that code base.
Last edit: 10 years 6 months ago by Chris.
Please Log in or Create an account to join the conversation.