Added sanity check for import.enabled in PATCH request

This commit is contained in:
arabcoders
2025-05-05 16:56:54 +03:00
parent 75073c8597
commit bcbe71a158

View File

@@ -160,6 +160,13 @@ final class Update
$userContext->config->set($key, $value);
}
# -- sanity check.
if (true === (bool)$userContext->config->get("{$name}.import.enabled", false)) {
if ($userContext->config->has("{$name}.options." . Options::IMPORT_METADATA_ONLY)) {
$userContext->config->delete("{$name}.options." . Options::IMPORT_METADATA_ONLY);
}
}
$userContext->config->persist();
$backend = $this->getBackends(name: $name, userContext: $userContext);