Hi,
I want to use a new course view script, so I have done the next, as it's explained in the official Moodle documentation:
-I have created new folder customscripts, new folder course and I've added the view.php file (the same it's in the core of Moodle, but without the import of config.php).
-I have this weird error:
Coding error detected, it must be fixed by a programmer: The theme has already been set up for this page ready for output. Therefore, you can no longer change the theme, or anything that might affect what the current theme is, for example, the course.
-I have tried to find out the reason for the error. It seems simple: after my custom scripts, it's trying to execute the original script (view.php) after the execution of the custom script , so it tries to set theme twice (and call to set_header() twice, etc...)
I don't know if this is the normal behaviour for custom scripts, but it seems it makes no sense.
Finally I have included a "patch" in lib\setup.php to prevent the execution of the "original" script
if (($customscript = custom_script_path()) !== false) {
require ($customscript);
die(); //<--THIS IS THE PATCH
}
Can anybody tell me if I'm wrong? Thanks all.
Jean.