Course Search is broken

Course Search is broken

by Conor Bradley -
Number of replies: 2

I'm running into a problem on my Moodle where the course search is only returning certain courses and not others.

I've rolled over my Moodle for the year and moved all last years courses into a hidden archive section. Then I created new courses for the year using the courses in the archive as template. 

My issue is that when I search for a course I know exists, I get the course in the archive as a result but not the new course (which I can find fine by navigating through the course categories). 

Any ideas?

(and as a side note is there a way to stop the search from showing courses in the hidden archive section?)

I'm running Moodle 3.0 with the BCU theme.

Average of ratings: -
In reply to Conor Bradley

Re: Course Search is broken

by Melanie Scott -
Picture of Particularly helpful Moodlers

I'm still running 2.8, so I may not be up to date on some stuff...

I do basically the same thing you do, move all the courses to an archive area (I don't hide them, I just make them hard to find because I want people to be able to access old transcripts and hidden courses don't show up on my reports) and then copy them to a new year. 

Can't quite figure why your new courses wouldn't show, unless you changed something in the titles.  All my course titles include the course year (we use fiscal years, July-June, so all courses running now are coursename FY17, etc) and then I (and all my staff) can tack the year to the search and be sure to get it.  Is your search (and I mean what you enter, not the core search thing) looking for coursename or shortname or both?  Shortnames have to be unique, so that would cause a problem.

As for your side note...other than adding an annual identifier like I described and searching using it, no, no way to hide hidden courses.  The good thing, though, is only people with site level permissions can see those in the search.  If the courses are truly hidden, when a student searches, hidden courses don't display.  If only the category is hidden, they will.

In reply to Melanie Scott

Re: Course Search is broken

by Conor Bradley -

Thanks for the reply Melanie - thankfully we found the underlying issue.

Somehow when we copied the new years courses from the archived courses using course upload csv, the process put 'NULL' values for the course's idnumber and summary. Somehow this meant that when search.php looked at the courses it saw 'NULL' for those courses, decided there was a problem and just ignored them. 

We had one of our developers update the Moodle MySQL database to change the 'NULL' values to just a space and this resolved the issue. Not sure what went wrong with course upload - hopefully it hasn't caused any other damage to the database.