From: Tim Düsterhus Date: Thu, 21 Sep 2023 10:39:53 +0000 (+0200) Subject: Fix the response mapping for the license API X-Git-Tag: 6.0.0_RC_2~14 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=539d69905af8b19778e91b8491de65c5ef26164f;p=GitHub%2FWoltLab%2FWCF.git Fix the response mapping for the license API The authCode is an optional value. --- diff --git a/wcfsetup/install/files/lib/acp/form/FirstTimeSetupLicenseForm.class.php b/wcfsetup/install/files/lib/acp/form/FirstTimeSetupLicenseForm.class.php index dc566a5508..f5427d06f7 100644 --- a/wcfsetup/install/files/lib/acp/form/FirstTimeSetupLicenseForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/FirstTimeSetupLicenseForm.class.php @@ -138,7 +138,7 @@ final class FirstTimeSetupLicenseForm extends AbstractFormBuilderForm array { status: 200, license: array { - authCode: string, + authCode?: string, type: string, expiryDates?: array, }, @@ -189,7 +189,7 @@ final class FirstTimeSetupLicenseForm extends AbstractFormBuilderForm Option::getOptionByName('first_time_setup_state')->optionID => 1, ]; - if (isset($this->apiResponse)) { + if (isset($this->apiResponse) && isset($this->apiResponse['license']['authCode'])) { $optionData[Option::getOptionByName('package_server_auth_code')->optionID] = $this->apiResponse['license']['authCode']; } diff --git a/wcfsetup/install/files/lib/acp/form/LicenseEditForm.class.php b/wcfsetup/install/files/lib/acp/form/LicenseEditForm.class.php index c2ccd8b28e..ae465e4a96 100644 --- a/wcfsetup/install/files/lib/acp/form/LicenseEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LicenseEditForm.class.php @@ -186,7 +186,7 @@ final class LicenseEditForm extends AbstractFormBuilderForm array { status: 200, license: array { - authCode: string, + authCode?: string, type: string, expiryDates?: array, }, @@ -238,7 +238,7 @@ final class LicenseEditForm extends AbstractFormBuilderForm $objectAction->executeAction(); } - if (isset($this->apiResponse)) { + if (isset($this->apiResponse) && isset($this->apiResponse['license']['authCode'])) { $optionData = [ Option::getOptionByName('package_server_auth_code')->optionID => $this->apiResponse['license']['authCode'], ]; diff --git a/wcfsetup/install/files/lib/acp/page/LicensePage.class.php b/wcfsetup/install/files/lib/acp/page/LicensePage.class.php index b3eb889760..ef23f57517 100644 --- a/wcfsetup/install/files/lib/acp/page/LicensePage.class.php +++ b/wcfsetup/install/files/lib/acp/page/LicensePage.class.php @@ -657,7 +657,7 @@ final class LicensePage extends AbstractPage array { status: 200, license: array { - authCode: string, + authCode?: string, type: string, expiryDates?: array, },