{"record":{"id":"608a625f1421de02","repo":"passbolt/passbolt_api","slug":"additional-resource-types-are-not-enabled-on-this-server","errorCode":null,"errorMessage":"Additional resource types are not enabled on this server.","messagePattern":"Additional resource types are not enabled on this server\\.","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"src/Service/Resources/ResourcesUpdateService.php","lineNumber":142,"sourceCode":"        return $this->Resources->get($id);\n    }\n\n    /**\n     * Make sure the default resource type is set on update to support backward compatibility checks\n     * Also assert only default resource type is used if plugin is marked as disabled by admin\n     *\n     * @param array $meta The filtered request data\n     * @throws \\Cake\\Http\\Exception\\BadRequestException if non default resource type is used when plugin is disabled\n     * @return array updated $meta if needed\n     */\n    private function presetOrAssertResourceType(array $meta): array\n    {\n        $defaultType = ResourceTypesTable::getDefaultTypeId();\n        if (!isset($meta['resource_type_id'])) {\n            $meta['resource_type_id'] = $defaultType;\n        } elseif (!Configure::read('passbolt.plugins.resourceTypes.enabled')) {\n            if ($meta['resource_type_id'] !== $defaultType) {\n                throw new BadRequestException(__('Additional resource types are not enabled on this server.'));\n            }\n        }\n\n        return $meta;\n    }\n\n    /**\n     * Extract the resource meta data from the request data\n     *\n     * @param \\Passbolt\\Metadata\\Model\\Dto\\MetadataResourceDto $resourceDto The request data\n     * @return array\n     */\n    private function extractDataResourceMeta(MetadataResourceDto $resourceDto): array\n    {\n        $meta = [];\n\n        $data = $resourceDto->toArray();\n        foreach ($resourceDto->getMetadataProps() as $metadataProp) {","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Service/Resources/ResourcesUpdateService.php#L124-L160","documentation":"ResourcesUpdateService::presetOrAssertResourceType defaults meta.resource_type_id to the default type, but if a caller supplies a non-default resource_type_id while the resourceTypes plugin is disabled (passbolt.plugins.resourceTypes.enabled is false), it throws BadRequestException (HTTP 400). Additional (v5-style) resource types are a plugin-gated feature; without the plugin only the default type is acceptable.","triggerScenarios":"PUT /resources/{id} with meta.resource_type_id set to a custom/extended type while the resourceTypes plugin is disabled in config; clients sending resource_type_id unconditionally when the server runs without the plugin.","commonSituations":"Server upgraded or plugin disabled after clients adopted v5 resource types; config/passbolt.php missing the resourceTypes plugin enablement; mixed-version fleet where newer clients hit older servers.","solutions":["Enable the resourceTypes plugin (passbolt.plugins.resourceTypes.enabled = true in config) if non-default types are required.","Omit resource_type_id from the meta payload so the default type is applied.","Send the default resource type id explicitly when the plugin is disabled.","Align client version/feature flags with server plugin state."],"exampleFix":"// before\n// config/passbolt.php\n'plugins' => ['resourceTypes' => ['enabled' => false]],\n// client sends: meta: { resource_type_id: 'v5-custom-uuid' }\n// after\n'plugins' => ['resourceTypes' => ['enabled' => byKey('passbolt.plugins.resourceTypes.enabled', true)]],\n// or client sends no resource_type_id (default applies)","handlingStrategy":"validation","validationCode":"if (isset($meta['resource_type_id']) && $meta['resource_type_id'] !== ResourceTypesTable::getDefaultTypeId() && !Configure::read('passbolt.plugins.resourceTypes.enabled')) { /* drop or fix resource_type_id */ }","typeGuard":null,"tryCatchPattern":"try { $service->update($uac, $id, $data); } catch (BadRequestException $e) { /* omit resource_type_id or enable plugin */ }","preventionTips":["Gate v5 resource-type payloads on server plugin support","Omit resource_type_id when unsure (default applies)","Keep client feature flags synced with server config"],"tags":["resources","resource-types","plugin","bad-request","feature-flag"],"backgroundTag":"feature-not-enabled","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}