Issue restoring backup (own plugin code issue)

Issue restoring backup (own plugin code issue)

by David Belenguer -
Number of replies: 0

I've been several weeks trying to fix a plugin that we use to mix courses  (reading from a webservice that returns what courses need to join together). It has been working until we updated Moodle to 2.9.1 (the last version i think it was 2.6.2) and the backing up part doesn't work now, the restore function doesn't find the backup.

Doing it manually is not an option because that would take a large amount of work. I thing the code was based on Moodle's code and something should have changed on the update to 2.9.1. I'll attach the code with this post, I hope somebody could help me, I create the restore_controller on the line 191 and there's where I get the error. On the line 237 I create the backup_controller. It generates the backup but the ZipArchive php's utility it doesn't recognizes as a ZIP (as it does in past Moodle versions). I can open it with 7zip an inside of it there's another file with no extension but with the content of the backup inside.

Spanish:

Llevo varias semanas intentando arreglar un plugin que usamos para juntar grupos (leemos de un webservice que devuelve que cursos hay que juntar). Ha funcionado hasta que hemos actualizado a la versión 2.9.1 de Moodle (la última versión creo que fue la 2.6.2), la parte de la copia de seguridad de un curso al otro no funciona ahora, la función de restaurar no encuentra el backup.

Hacerlo manualmente no es una opción, ya que eso llevaría mucho trabajo. Creo que el código se basó en código de Moodle y algo debe haber cambiado con la actualización a la versión 2.9.1. Adjuntaré el código en este post. Espero que alguien pueda ayudarme. Instancio el restore_controller en la linea 191 y ahí es donde me da el error. En la linea 237 instancio el backup_controller. Genera el backup pero la utilidad ZipArchive de php no lo reconoce como un .zip (como hacía en anteriores versiones de Moodle). Puedo abrirlo con el 7zip y dentro tiene otro archivo sin extensión pero con el contenido del backup dentro.


Average of ratings: -