critical: plugin zips deploy files to group root instead of element subdirectory #300

Open
opened 2026-06-21 05:33:28 +00:00 by jmiller · 2 comments
Owner

Problem

When release_package.php builds plugin sub-extension zips for a Joomla package, some plugins' files get installed to plugins/{group}/ (the group root) instead of plugins/{group}/{element}/. This causes:

  1. services/provider.php from one plugin overwrites the same path from another
  2. src/, language/ directories leak into the group root
  3. Fatal errors on every page load because Joomla loads the wrong provider.php

Impact

Site-breaking — every update to MokoSuiteClient breaks the site with:

Class "Moko\Plugin\System\MokoSuiteClientBackup\Extension\Backup" not found

or

Class "Moko\Plugin\System\MokoSuiteClientOffline\Extension\Tos" not found

The file at plugins/system/services/provider.php keeps getting overwritten by different plugins' provider files.

Root Cause

The plugin zip files built by release_package.php likely have incorrect internal paths. Each plugin zip should contain files relative to the plugin root:

services/provider.php
src/Extension/Tos.php
language/en-GB/...

Joomla then installs these to plugins/{group}/{element}/. But if the element is empty or the zip structure is wrong, files go to plugins/{group}/ directly.

Affected Plugins

All system plugins in pkg_mokosuiteclient:

  • plg_system_mokosuiteclient_offline
  • plg_system_mokosuiteclient_backup
  • plg_system_mokosuiteclient_firewall
  • plg_system_mokosuiteclient_tenant
  • plg_system_mokosuiteclient_devtools
  • plg_system_mokosuiteclient_dbip

Workaround

Manually delete stale files after each update:

rm -rf plugins/system/services plugins/system/src plugins/system/language

Fix Required

Verify that release_package.php creates plugin zips with correct internal structure and that the package manifest's <file> elements have correct id attributes matching the plugin element names.

## Problem When `release_package.php` builds plugin sub-extension zips for a Joomla package, some plugins' files get installed to `plugins/{group}/` (the group root) instead of `plugins/{group}/{element}/`. This causes: 1. `services/provider.php` from one plugin overwrites the same path from another 2. `src/`, `language/` directories leak into the group root 3. **Fatal errors on every page load** because Joomla loads the wrong provider.php ## Impact **Site-breaking** — every update to MokoSuiteClient breaks the site with: ``` Class "Moko\Plugin\System\MokoSuiteClientBackup\Extension\Backup" not found ``` or ``` Class "Moko\Plugin\System\MokoSuiteClientOffline\Extension\Tos" not found ``` The file at `plugins/system/services/provider.php` keeps getting overwritten by different plugins' provider files. ## Root Cause The plugin zip files built by `release_package.php` likely have incorrect internal paths. Each plugin zip should contain files relative to the plugin root: ``` services/provider.php src/Extension/Tos.php language/en-GB/... ``` Joomla then installs these to `plugins/{group}/{element}/`. But if the element is empty or the zip structure is wrong, files go to `plugins/{group}/` directly. ## Affected Plugins All system plugins in pkg_mokosuiteclient: - plg_system_mokosuiteclient_offline - plg_system_mokosuiteclient_backup - plg_system_mokosuiteclient_firewall - plg_system_mokosuiteclient_tenant - plg_system_mokosuiteclient_devtools - plg_system_mokosuiteclient_dbip ## Workaround Manually delete stale files after each update: ```bash rm -rf plugins/system/services plugins/system/src plugins/system/language ``` ## Fix Required Verify that `release_package.php` creates plugin zips with correct internal structure and that the package manifest's `<file>` elements have correct `id` attributes matching the plugin element names.
Author
Owner

Root cause was NOT in mokocli. The MokoSuiteClient install script had an ALTER TABLE in preflight that set element column to DEFAULT ''. This caused Joomla to install plugin files to plugins/{group}/ root instead of plugins/{group}/{element}/. Fixed by removing the ALTER TABLE from MokoSuiteClient's script.php. No mokocli changes needed.

Root cause was NOT in mokocli. The MokoSuiteClient install script had an ALTER TABLE in preflight that set element column to DEFAULT ''. This caused Joomla to install plugin files to plugins/{group}/ root instead of plugins/{group}/{element}/. Fixed by removing the ALTER TABLE from MokoSuiteClient's script.php. No mokocli changes needed.
jmiller reopened this issue 2026-06-21 06:10:10 +00:00
Author
Owner

Reopening — ALTER TABLE fix did not resolve the issue. Even after removing DEFAULT '' from the element column and cleaning all stale files, the next package update still installs plugin files to plugins/system/ root instead of plugins/system/{element}/.

The problem IS in release_package.php — the sub-extension zip files have incorrect internal structure. The plugin zips need their files at the root of the zip so Joomla installs them to the correct element subdirectory. Currently the zip structure or the package manifest element mapping is wrong.

This is site-breaking on every update.

Reopening — ALTER TABLE fix did not resolve the issue. Even after removing DEFAULT '' from the element column and cleaning all stale files, the next package update still installs plugin files to plugins/system/ root instead of plugins/system/{element}/. The problem IS in release_package.php — the sub-extension zip files have incorrect internal structure. The plugin zips need their files at the root of the zip so Joomla installs them to the correct element subdirectory. Currently the zip structure or the package manifest element mapping is wrong. This is site-breaking on every update.
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/mokocli#300