this academic year we migrated to version 3.6 from 3.2; whenever we migrate, we spend two people preparing for months to test and adapt both third-party plugins (more than 60) and all our own developments. In our tests we do not detect a problem that is giving us enough war with the teachers.
For years we have our own block called "adminprofesorado" where we provide the teacher certain functions of moodle without knowing moodle. Among the options have a so-called "Merge my courses". In essence it is a form where we show all the user's courses not yet merged by checkbox and a text box to provide a name for the new course that includes the merged. After marking two or more checkboxes of the courses you want to merge and providing a name, we collect the form data to create a new course and for each marked checkbox we create a metalink to the newly created course through the function $ enroll-> add_instance () and we hide this course so that the students only see the goal and not the child courses that are part of the merger.
With the previous version 3.2 and the previous 2.8 of the last 4 years no problem. However, this year we are surprised that 20% of mergers are not made, that is, the new META course is created, each child course is hidden but the add_instance () function fails and we don't know why.
Testing in our multi-merger testing environment we have not been able to reproduce the error and what is worse, in the virtual production campus itself either. We have reviewed the PHP LOG without a trace of the problem, we have reviewed moodle.org forums and possible bugs and neither; We have reviewed the Moodle API and the functions have not changed since 3.2
The truth is that we are baffled with this problem and do not know what happens so that the function of adding metalinks sometimes fails. We believe that the problem may be in some function of one of the third-party plugins that we have installed but it does not leave any clues of the problem in Apache or PHP.
Any idea of this problem? Has something similar happened to someone by merging courses either through a similar development or through the interface itself?