center-for-learning-management / moodle-block_gps

Moodle Block Plugin to determine the current user-position
GNU General Public License v3.0
2 stars 0 forks source link

Error "invalidrecord: Can't find data record in database table course" #5

Open semteacher opened 2 years ago

semteacher commented 2 years ago

Have installed plugin on Moodle 3.9 Issue: pop-up "invalidrecord - Can't find data record in database table course." appears on few cases:

PS: Map tab is working, location more or less correct

rschrenk commented 2 years ago

Hello, the error message indicates, that the course with the ID 0 is loaded from the database. The error must be caused by a wrong AJAX request. You wrote, that you switch form the "Maps"-Page to the "List"-Page. In my case the course id is part of the URL:

wwwroot/blocks/gps/list.php?id=363

How is your URL?

I tried to navigate here and there and everything seemed to work.

Kind regards

semteacher commented 2 years ago

I have created 2 bloc instances: on site home and under course. Errors available in both. More over - same error appears when I press even only "update" button. Example of URL's: on site/course page when pressing "update" wwwroot/?redirect=0 wwwroot/course/view.php?id=2 inside block, when pressing "location" on list page wwwroot/blocks/gps/list.php?id=2# wwwroot/blocks/gps/list.php?id=1#

rschrenk commented 2 years ago

I am sorry, I think I do not understand where you are exactly on the page. Can you share screenshots or a screencast with me?

semteacher commented 2 years ago

Block on site home. Pressing "update" https://screenrec.com/share/6W2tchNzQH Inside block instance on site home, pressing "location" (list/map tabs) https://screenrec.com/share/cM0yp4JStz Block on course page. Pressing "update". https://screenrec.com/share/cGA1gN9Mrp Inside block instance on course page, pressing "location" (list/map tabs) https://screenrec.com/share/JOSCNnTa4W

rschrenk commented 2 years ago

Hello,

Ok, what I see is that the error shown in the popup is caused by the block_gps-Plugin. But I can also see error messages in the background regarding the course_renderer. So these errors come first when the page is displayed. The popup is shown after you click something on the page. Maybe the other error is the root cause. You should fix that error first and then see if the problem with block_gps persists.

Do you have shell access to your webserver? You should spot your error-log and search for a stack trace of the error regarding the course_renderer. If we can figure out, what is causing this, we maybe find a solution. It may also be caused by block_gps - but maybe not.

Kind regards

semteacher commented 2 years ago

Hello Sorry, but I just want to sign - I have got the same errors yesterday on Moodle Boost theme without ANY other reported issue!