I haven't actually tried it but i think in theory:
if you have custom controllers that inherit RenderMvcController, you could change that so they inherit MaintenanceModeMvcController and then they too would go through the Maintenace mode process and hit the page as needed.
It basically works if I do it that way - only a few pitfalls I came across.
If I use a custom model for the page I´m getting this:
So I tried to check the maintenanceService but I can´t access the maintenanceService from the MaintenanceModeMvcController, so I need to add it to every single page.
So this element fixes the error:
if(_maintenanceModeService.IsInMaintenanceMode)
Ideally, the maintenanceService and the runtimeState and IsBackOfficeUserLoggedIn would be protected instead of private in MaintenanceModeMvcController, then I could access them from my controller.
The way it is now, I probably have to duplicate the logic in an additional Controller, that I then put in between my controllers and the MaintenanceModeMvcController.
Not sure if there is a way to cast the model back to it´s original type through reflection.
Maintenance Manager: RenderMvcController
Hi,
we wanted to add Maintenance Manager to one of our older pages in Umbraco v8.
It turns out, it doesn´t work with pages that extend RenderMvcController. Is this a known issue, and is there a workaround?
Best, Gerhard
Hi,
I haven't actually tried it but i think in theory:
if you have custom controllers that inherit
RenderMvcController
, you could change that so they inheritMaintenanceModeMvcController
and then they too would go through the Maintenace mode process and hit the page as needed.Thanks for the quick response!
It basically works if I do it that way - only a few pitfalls I came across.
If I use a custom model for the page I´m getting this:
So I tried to check the maintenanceService but I can´t access the maintenanceService from the MaintenanceModeMvcController, so I need to add it to every single page.
So this element fixes the error: if(_maintenanceModeService.IsInMaintenanceMode)
Ideally, the maintenanceService and the runtimeState and IsBackOfficeUserLoggedIn would be protected instead of private in MaintenanceModeMvcController, then I could access them from my controller.
The way it is now, I probably have to duplicate the logic in an additional Controller, that I then put in between my controllers and the MaintenanceModeMvcController.
Not sure if there is a way to cast the model back to it´s original type through reflection.
But overall, it´s a way to go.
Got everything to work on my local machine, now we tried to deploy to webserver - and there I get the same issue as described here:
https://our.umbraco.com/forum/using-umbraco-and-getting-started/102180-maintenance-manager-service-is-not-available
It works locally, it works if I call the site locally on the server, but it doesn´t work if I call it from the website url. Any ideas?
is working on a reply...