-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Short description of the issue
ModuleJS::init() no longer loads module CSS/JS assets after commit 3653a70 (fix for #2175).
The refactored code collects asset URLs into an array but never registers them with $config->styles or $config->scripts.
Expected behavior
Modules extending ModuleJS (like JqueryWireTabs, LanguageTabs, etc.) should have their CSS and JS files automatically loaded when the module is instantiated via $modules->get().
Actual behavior
CSS and JS files for ModuleJS-based modules are not loaded, causing JavaScript errors throughout the admin:
Uncaught TypeError: $(...).WireTabs is not a function
at HTMLDocument. (ProcessModule.js:27:28)
Uncaught TypeError: $(...).WireTabs is not a function
at initPageEditForm (ProcessPageEdit.js:4:57)
Screenshots/Links that demonstrate the issue
Network tab shows JqueryWireTabs.js is missing from loaded scripts.
Console shows the TypeError above on any page using tabs (Modules, Page Edit, etc.).
Suggestion for a possible fix
In wire/core/ModuleJS.php, the second foreach loop (around line 136) collects URLs but doesn't add them. Replace:
foreach($assets as $basename) {
$file = $modulePath . $basename;
$fileUrl = $moduleUrl . $basename;
if($useVersionUrls === null) {
if($debug) $version = filemtime($file);
$fileUrl .= "?v=$version";
}
$assetUrls[] = $fileUrl;
}
With:
foreach($assets as $key => $basename) {
$file = $modulePath . $basename;
$fileUrl = $moduleUrl . $basename;
if($useVersionUrls === null) {
if($debug) $version = filemtime($file);
$fileUrl .= "?v=$version";
}
if($key === 'css') {
if($this->loadStyles) $config->styles->add($fileUrl);
} else {
if($this->loadScripts) $config->scripts->add($fileUrl);
}
}
Steps to reproduce the issue
- Update to ProcessWire dev branch (commit 3653a70 or later, version 3.0.255)
- Open any admin page using WireTabs (e.g., /processwire/module/ or /processwire/page/edit/?id=1)
- Open browser DevTools Console
- Observe "WireTabs is not a function" error
- Check Network tab - confirm JqueryWireTabs.js is not loaded
Setup/Environment
- ProcessWire version: 3.0.255 (dev branch, commit 3653a70 or later from Jan 30, 2026)
- PHP version: 8.x
- Related: Regression introduced by fix for ModulesFiles::loadModuleFileAssets() should consider "$config->useVersionUrls"? #2175