OneTopic Error - Unknown course section in course "XXX"

OneTopic Error - Unknown course section in course "XXX"

by Mark Terranova -
Number of replies: 12

We are using Moodle 3.3.4 with a mySQL database and the OneTopic plugin version san juan (2018010602). However, after an the upgrade of Moodle from 3.1.5 to 3.3.4 some course are now displaying the error message, "Unknown course section in course "XXX"", if they are set to the OneTopic format. If we switch the format to Topics the course shows fine.

I am currently not aware of how the error is being produced, so I cannot list how to replicate it for testing.

Is there any way to possible resolve the error?


Attachment OneTopic Error.PNG
Average of ratings: -
In reply to Mark Terranova

Ats.: OneTopic Error - Unknown course section in course "XXX"

by Danutė Pranckutė -

Dear Mark, for us - the same problem mixed

We are testing 3.5.1+ with One topic format (Release date: 2018-07-26) and some courses ok, bus some have this error "Unknown course section in course "XXX". It's would be great to hear about the solution to the problem smile

Attachment error_onetopic_format.png
In reply to Danutė Pranckutė

Re: Ats.: OneTopic Error - Unknown course section in course "XXX"

by Mark Terranova -

I have some bad news. We have not found a way to reproduce the error and/or solve the error. However, as a workaround we did find that if the course is backed up and restored the error goes away. Also, if the course format is switched from OneTopic to Topics the error goes away.

Please, if you find out any more information about why it is occurring and/or how to resolve it please let me know.

Thank you.

In reply to Mark Terranova

Re: Ats.: OneTopic Error - Unknown course section in course "XXX"

by Cristhian Alexander Gomez Rosero -

In my case the error was presented when using the "tabs" format. However, I managed to solve it.


What I did was put the course in "topics" or "weeks" format and select a section that was not empty and put it in "highlight" (I use Moodle in Spanish so I do not know how you put it in English), after that I put it back in the "tabs" format and it was working. I did this many times and yes, that was the error in my case.


I think a kind of bug is generated when Moodle sees empty sections, there may be the core of the problem. 


In reply to Mark Terranova

Re: OneTopic Error - Unknown course section in course "XXX"

by Mike Kelly -

I've also just run into this problem, on a Moodle 3.5.1 server with OneTopic "san juan (2018010604)". Has anyone reported this to the OneTopic developer yet?

In reply to Mark Terranova

Re: OneTopic Error - Unknown course section in course "XXX"

by Mark Terranova -

I have reported it to the Developer on GitHub, https://github.com/davidherney/moodle-format_onetopic/issues/45#issuecomment-407979884, as well., he has taken notice to it there.

In reply to Mark Terranova

Re: OneTopic Error - Unknown course section in course "XXX"

by Joost van der Borg -
I've tested a fix for this issue on my development environment, and provided a patch to the author. This has been added to the master branch on GitHub. If anyone else can test, he will add it to the next release. Details: https://github.com/davidherney/moodle-format_onetopic/issues/45#issuecomment-412090457
In reply to Mark Terranova

Re: OneTopic Error - Unknown course section in course "XXX"

by Kat Bodine -

We have a client who encountered this error also and I believe we  may have found the cause and solution for this error. 

From a very non-technical standpoint, With the changes in Moodle version 3.4, the course end date is calculated by the number of topics AND at that same time, we saw during upgrades of client sites, that empty topics were being removed from the courses.  My theory is that the courses having these issues, may have had one or more empty topics that were removed which caused the error.

I conducted a test on one of the problem courses, whereby I added several extra course sections and I this appears to have fixed the problem.  How many sections is relative to what was there before. 

Average of ratings: Useful (2)
In reply to Kat Bodine

Re: OneTopic Error - Unknown course section in course "XXX"

by Joost van der Borg -

The issue is definitely related to the amount of sections in the course. In certain cases, when no specific section is requested, the format will try to load a course section that doesn't exist. Adding (enough) sections gives that code a valid section, preventing the error. The bugfix I tested seems to prevent this (by first checking how many sections actually exist). After the plugin is updated, your workaround shouldn't be necessary anymore. Until then, this should work. The exact amount of sections you need to add can vary though. 

In reply to Mark Terranova

Re: OneTopic Error - Unknown course section in course "XXX"

by Cristhian Alexander Gomez Rosero -

In my case the error was presented when using the "tabs" format. However, I managed to solve it.


What I did was put the course in "topics" or "weeks" format and select a section that was not empty and put it in "highlight" (I use Moodle in Spanish so I do not know how you put it in English), after that I put it back in the "tabs" format and it was working. I did this many times and yes, that was the error in my case.


I think a kind of bug is generated when Moodle sees empty sections, there may be the core of the problem. Well, I hope I could help you.

In reply to Mark Terranova

Re: OneTopic Error - Unknown course section in course "XXX"

by David Herney -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi...

I fixed a related issue in the MOODLE_33_select_visible_tab_by_default branch (Moodle 3.3+, 3.4+ and 3.5+). I think that it fix this problem also. It is a big change and I need other testers before public it officially. Please, help me testing this branch and send me the comments into the issue page: https://github.com/davidherney/moodle-format_onetopic/issues/45.


Thx


Saludos


In reply to Mark Terranova

Re: OneTopic Error - Unknown course section in course "XXX"

by Samuli Karevaara -

This is happening to us also. The workaround is to add enough empty sections (tabs) so that the "missing" section is also found. But this is a bit ugly as the user is thrown on an empty tab + a bunch of empty tabs is floating around.

A question: where is the "current" tab stored? Is it stored for each user? How can I "reset" this to zero?

In our case the error happens if the course is entered without any login, not a guest account but as a non-logged-in user.

In reply to Samuli Karevaara

Re: OneTopic Error - Unknown course section in course "XXX"

by Andrew Molteno -

Just in case anyone has this issue and is not able to upgrade the plugin, following Cristhian's advice, we just highlighted a random tab, re-loaded the course and then removed the highlight. There was no need to change the format.