Bug: site alias offline parameter does not trigger offline mode #72

Closed
opened 2026-05-28 18:09:02 +00:00 by jmiller · 1 comment
Owner

Summary

When a site alias is configured via the MokoWaaS plugin subform with offline set to 1, visiting the alias domain does not trigger Joomla's offline mode. The site continues to render normally.

Root Cause

handleSiteAlias() is called in onAfterRoute() (line ~900), which sets $this->app->getConfig()->set('offline', 1). However, Joomla checks the offline config value before onAfterRoute fires — during the application's doExecute() method. By the time the plugin sets offline=1, Joomla has already decided to render the site normally.

Relevant code path

  1. onAfterRoute()handleSiteAlias()$this->app->getConfig()->set('offline', 1) (line ~2968)
  2. But Joomla's SiteApplication::doExecute() checks $this->get('offline') before dispatching, so the plugin's change comes too late.

Expected Behavior

When an alias domain has offline: 1 set in the subform, visiting that domain should show Joomla's offline page (rendered through the template's offline.php).

Suggested Fix

Move the alias offline check to onAfterInitialise() instead of onAfterRoute(). The onAfterInitialise event fires early enough that setting offline=1 in the config will be respected by Joomla's application execution flow.

Alternatively, instead of relying on Joomla's native offline mode, render the offline page directly and call $this->app->close() — similar to how the emergency access handler works.

Environment

  • MokoWaaS plugin version: 02.01.08
  • Joomla: 5.x
  • Server: mokoconsulting.tech (DreamHost)
## Summary When a site alias is configured via the MokoWaaS plugin subform with `offline` set to `1`, visiting the alias domain does not trigger Joomla's offline mode. The site continues to render normally. ## Root Cause `handleSiteAlias()` is called in `onAfterRoute()` (line ~900), which sets `$this->app->getConfig()->set('offline', 1)`. However, Joomla checks the `offline` config value **before** `onAfterRoute` fires — during the application's `doExecute()` method. By the time the plugin sets `offline=1`, Joomla has already decided to render the site normally. ### Relevant code path 1. `onAfterRoute()` → `handleSiteAlias()` → `$this->app->getConfig()->set('offline', 1)` (line ~2968) 2. But Joomla's `SiteApplication::doExecute()` checks `$this->get('offline')` **before** dispatching, so the plugin's change comes too late. ## Expected Behavior When an alias domain has `offline: 1` set in the subform, visiting that domain should show Joomla's offline page (rendered through the template's `offline.php`). ## Suggested Fix Move the alias offline check to `onAfterInitialise()` instead of `onAfterRoute()`. The `onAfterInitialise` event fires early enough that setting `offline=1` in the config will be respected by Joomla's application execution flow. Alternatively, instead of relying on Joomla's native offline mode, render the offline page directly and call `$this->app->close()` — similar to how the emergency access handler works. ## Environment - MokoWaaS plugin version: 02.01.08 - Joomla: 5.x - Server: mokoconsulting.tech (DreamHost)
Author
Owner

Branch created: feature/72-bug-site-alias-offline-parameter-does-no

git fetch origin
git checkout feature/72-bug-site-alias-offline-parameter-does-no
Branch created: [`feature/72-bug-site-alias-offline-parameter-does-no`](https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/src/branch/feature/72-bug-site-alias-offline-parameter-does-no) ```bash git fetch origin git checkout feature/72-bug-site-alias-offline-parameter-does-no ```
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoWaaS#72