scss autoloader + jsonresponse fixes

Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
Andy Miller
2025-12-29 08:07:59 -08:00
parent 24da355b47
commit 3b5caaf4e8
3 changed files with 71 additions and 15 deletions

View File

@@ -1041,15 +1041,16 @@ class AdminController extends AdminBaseController
$result = Gpm::install(array_keys($dependencies), ['theme' => $type === 'themes']);
if ($result) {
$this->admin->json_response = ['status' => 'success', 'message' => 'Dependencies installed successfully'];
$json_response = ['status' => 'success', 'message' => 'Dependencies installed successfully'];
} else {
$this->admin->json_response = [
$json_response = [
'status' => 'error',
'message' => $this->admin::translate('PLUGIN_ADMIN.INSTALLATION_FAILED')
];
}
return true;
// Exit early to prevent any post-install code from running with potentially mismatched autoloaders
$this->sendJsonResponse($json_response);
}
/**
@@ -1094,19 +1095,20 @@ class AdminController extends AdminBaseController
}
if ($result) {
$this->admin->json_response = [
$json_response = [
'status' => 'success',
'message' => $this->admin::translate(is_string($result) ? $result : sprintf($this->admin::translate($reinstall ?: 'PLUGIN_ADMIN.PACKAGE_X_REINSTALLED_SUCCESSFULLY',
null), $package))
];
} else {
$this->admin->json_response = [
$json_response = [
'status' => 'error',
'message' => $this->admin::translate($reinstall ?: 'PLUGIN_ADMIN.INSTALLATION_FAILED')
];
}
return true;
// Exit early to prevent any post-install code from running with potentially mismatched autoloaders
$this->sendJsonResponse($json_response);
}
/**
@@ -1219,19 +1221,20 @@ class AdminController extends AdminBaseController
$result = Gpm::directInstall($url);
if ($result === true) {
$this->admin->json_response = [
$json_response = [
'status' => 'success',
'message' => $this->admin::translate(sprintf($this->admin::translate('PLUGIN_ADMIN.PACKAGE_X_REINSTALLED_SUCCESSFULLY',
null), $package_name))
];
} else {
$this->admin->json_response = [
$json_response = [
'status' => 'error',
'message' => $this->admin::translate('PLUGIN_ADMIN.REINSTALLATION_FAILED')
];
}
return true;
// Exit early to prevent any post-install code from running with potentially mismatched autoloaders
$this->sendJsonResponse($json_response);
}
/**