Jump to content

Module: Maintenance Mode


Pete

Recommended Posts

@abmcr - great that you've fixed it up, but I think it would be helpful to submit a PR to @Pete so that everyone will get this new version.

Please note that this module doesn't currently send proper 503 maintenance mode headers which is why I always use the protected mode module for this. Perhaps you could take care of adding the 503 stuff to this module as well?

Link to comment
Share on other sites

  • 2 months later...

I installed this module in version 3.0.123 but i gives me a error:

Fatal Error: Uncaught Error: Access to undeclared static property: MaintenanceMode::$fM in /xxx/xxx/xxx/public_html/site/modules/MaintenanceMode/MaintenanceMode.module:94
Stack trace:

#0 [internal function]: MaintenanceMode::getModuleConfigInputfields(Array)
#1 /home/xxxxk/domains/xxxxx.nl/public_html/wire/core/Modules.php(3885): call_user_func(Array, Array)
#2 /home/xxxxk/domains/xxxxx.nl/public_html/wire/core/Wire.php(386): ProcessWire\Modules->___getModuleConfigInputfields('MaintenanceMode', Object(ProcessWire\InputfieldForm))
#3 /home/xxxxk/domains/xxxxx.nl/public_html/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___getModuleCon...', Array)
#4 /home/xxxxk/domains/xxxxx.nl/public_html/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Modules), 'getModuleConfig...', Array)
#5 /home/xxxxk/domains/xxxxx.nl/public_html/wire/modules/Process/ProcessModule/ProcessModule.module(1255): ProcessWire\Wire->__call('getMo (line 94 of /home/devhk/domains/hk2.witxl.nl/public_html/site/modules/MaintenanceMode/MaintenanceMode.module)

What is wrong?

 

Link to comment
Share on other sites

@Pete, @Erik, seems to work with a tiny modification in the foreach loop (loading an intermediate variable with $fM['type']):

		// Now use $data and $fieldsModel loop to create all checkboxes
		foreach ($fieldsModel as $f=>$fM){
			$fmType = $fM['type'];
			$fields->add(
				self::$fmType($f, $fM['label'], $data[$f], $fM['desc'])
			);
		}

 

  • Like 3
Link to comment
Share on other sites

  • 1 month later...

An editor wanted to be able to preview the 'alternative page' we use during maintenance, but whenever he would try to view it he would be redirected to the homepage. So to me it makes sense that anyone who is allowed to bypass the maintenance page during maintenance, should also be able to preview the alternative page. 

Luckily, this is just a tiny code adjustment. Replace line 133-136 with:

		// Else if we're not in maintenance mode and we're not an administrator (and our role isn't in the list of allowed roles to access the site in maintenance mode), make sure the maintenance page redirects to the homepage
		} elseif (!$this->inMaintenance && $this->showPage && ($page->id == $this->showPage) && !$user->isSuperuser() && !array_intersect(explode('|', $user->roles), $this->bypassRoles)) {
			$this->session->redirect($this->config->urls->root, false);
		}

 

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...
On 8/24/2019 at 2:47 PM, antpre said:

@Adrian, thanks for you suggestion. But I need the redirect option found on the maintenance mode module. In my understanding this is not an option that your module provides ? Am I rigth ? Thanks

Not currently, but it could be a simple addition.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

When I install the module MaintenanceMode then I get this error message:

Breaking news… Fatal Error: Uncaught Error: Access to undeclared static property: MaintenanceMode::$fM in site/modules/MaintenanceMode/MaintenanceMode.module:94

#0 [internal function]: MaintenanceMode::getModuleConfigInputfields(Array)
#1 wire/core/Modules.php (3903): call_user_func(Array, Array)
#2 wire/core/Wire.php (400): Modules->___getModuleConfigInputfields('MaintenanceMode', Object(InputfieldForm))
#3 wire/core/WireHooks.php (823): Wire->_callMethod('___getModuleCon...', Array)
#4 wire/core/Wire.php (465): WireHooks->runHooks(Object(Modules), 'getModuleConfig...', Array)
#5 wire/modules/Process/ProcessModule/ProcessModule.module (1349): P (line 94 of site/modules/MaintenanceMode/MaintenanceMode.module)

What can I do?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...