more package info fixes

This commit is contained in:
crispycat 2024-05-27 00:24:49 -04:00
parent 06db1c99db
commit 872f035fb9

View File

@ -141,7 +141,7 @@
return null;
}
$id = $info["Package"]["id"] ?? null;
$id = $info["ExtensionInfo"]["id"] ?? $info["Package"]["id"] ?? null;
if (!$id) {
$this->status = static::ERR_UPLOAD_INVALID_PACKAGE;
$this->log("Invalid package (missing ID)", static::L_FATAL);
@ -149,7 +149,7 @@
return null;
}
$version = $info["Package"]["version"] ?? "";
$version = $info["ExtensionInfo"]["version"] ?? $info["Package"]["version"] ?? "0.0.0";
$this->log("Installing package $id v$version", $this::L_INFO);
try {
@ -169,7 +169,7 @@
$this->app->dispatcher->trigger("crispage.packages.upload.success");
return new Extension(
$id, $info["Package"]["version"] ?? "0.0.0", $id, $id,
$id, $version, $id, $id,
"package", $info["PackageData"] ?? []
);
}