Getting these error in Admin user, when i switch on debugging

Getting these error in Admin user, when i switch on debugging

by Rudraksh Batra -
Number of replies: 4
Hi,

I am getting this below error while switch on debugging in moodle 4, please advise what could be the reason and how to resolve ti

Did you remember to make the first column something unique in your call to get_records? Duplicate value 'student' found in column 'shortname'.
  • line 1287 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
  • line 38 of /theme/abc/layout/drawers.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 1477 of /lib/outputrenderers.php: call to include()
  • line 1403 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 179 of /my/index.php: call to core_renderer->header()
Did you remember to make the first column something unique in your call to get_records? Duplicate value 'editingteacher' found in column 'shortname'.
  • line 1287 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
  • line 38 of /theme/abc/layout/drawers.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 1477 of /lib/outputrenderers.php: call to include()
  • line 1403 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 179 of /my/index.php: call to core_renderer->header()

Regards


Average of ratings: -
In reply to Rudraksh Batra

Re: Getting these error in Admin user, when i switch on debugging

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

It looks like your site has a custom theme and these lines:

line 38 of /theme/abc/layout/drawers.php: call to mysqli_native_moodle_database->get_records_sql()

suggest the error is due to a problem with that theme.

Try switching to the default Boost theme and see if the errors still occur.
In reply to Leon Stringer

Re: Getting these error in Admin user, when i switch on debugging

by Rudraksh Batra -
Yes, i switched to boost default theme and this error warning goes, please advice what could be the reason.
In reply to Rudraksh Batra

Re: Getting these error in Admin user, when i switch on debugging

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Presumably the error is caused by a bug in your site's theme. But because the theme's source code doesn't appear to be publicly available (it's not in the Moodle Plugins directory) I can't help you further.

I suggest you contact the theme's author (their email might be in a file in the theme/abc folder), or whoever the theme was obtained from.

In reply to Rudraksh Batra

Re: Getting these error in Admin user, when i switch on debugging

by Gregor McNish -
If you look at your theme code
line 38 of /theme/abc/layout/drawers.php: call to mysqli_native_moodle_database->get_records_sql()
There will be an sql query just before it-- make sure the first column referenced in the query is unique -- currently it seems that the role name is the first column. Maybe change to username or something that will be unique depending on what the query is doing.
.