Hi all,
I seem to recall that recently some work being done broke upgrade and install, and as a result now renderers get overidden in some special way during updates.
Does anyone know about this, or can point me to somewhere documenting this? I've tried Googling but I'm not finding anything relevant. Currently I seem to get upgrade screens that are half my theme, and half... something else.
I seem to recall that recently some work being done broke upgrade and install, and as a result now renderers get overidden in some special way during updates.
Does anyone know about this, or can point me to somewhere documenting this? I've tried Googling but I'm not finding anything relevant. Currently I seem to get upgrade screens that are half my theme, and half... something else.
Hi David,
is this what you are meaning?
Read comments at start of document about API
https://github.com/moodle/moodle/blob/master/theme/bootstrapbase/layout/maintenance.php
Cheers
Mary
Thanks Mary,
it's not that exactly, but I think it's related. The bit of comment text that says "It's ultra important that this layout file makes no use of API's unless it absolutely needs to.", I seem to recall that got enforced by some code that swaps out theme renderers with other ones and that's what I'm hitting.
By looking up that bug, I found a link to this related bug which is what I was looking for,
https://tracker.moodle.org/browse/MDL-42057
regards,
dave
it's not that exactly, but I think it's related. The bit of comment text that says "It's ultra important that this layout file makes no use of API's unless it absolutely needs to.", I seem to recall that got enforced by some code that swaps out theme renderers with other ones and that's what I'm hitting.
By looking up that bug, I found a link to this related bug which is what I was looking for,
https://tracker.moodle.org/browse/MDL-42057
regards,
dave
I'm not sure what does it, but when in maintenance/upgrade/install the core_renderer gets swapped with core_renderer_maintenance (and not core_maintenance_renderer as the documentation in the theme/upgrade.txt calls it).
To achieve what I want, I want to extend this renderer in my theme the same way as I intend to extend the normal core_renderer (an unfortunate bit of code duplication, but there appear to be reasons for this). I've not tried it yet but I assume it will work, I just have to be careful.
To achieve what I want, I want to extend this renderer in my theme the same way as I intend to extend the normal core_renderer (an unfortunate bit of code duplication, but there appear to be reasons for this). I've not tried it yet but I assume it will work, I just have to be careful.
Oh ok,
The thing that does this is set by the line in the config.php file:
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
And its the class 'theme_overridden_renderer_factory' that performs the class auto-loading of the theme renderers by looking for the file 'renderers.php' in the themes root folder. If that class has been swapped out in favour of the standard core one then overriding will not work.