diff --git a/lib/Alchemy/Phrasea/Controller/Admin/FieldsController.php b/lib/Alchemy/Phrasea/Controller/Admin/FieldsController.php index 85b1fe1731..c13efa100d 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/FieldsController.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/FieldsController.php @@ -129,7 +129,7 @@ class FieldsController extends Controller { $vocabularies = $this->getVocabularies(); - $vocabulary = $vocabularies[$type]; + $vocabulary = $vocabularies[strtolower($type)]; Assertion::isInstanceOf($vocabulary, ControlProviderInterface::class); diff --git a/lib/Alchemy/Phrasea/ControllerProvider/Admin/Fields.php b/lib/Alchemy/Phrasea/ControllerProvider/Admin/Fields.php index 4d921391ba..b6f111a37a 100644 --- a/lib/Alchemy/Phrasea/ControllerProvider/Admin/Fields.php +++ b/lib/Alchemy/Phrasea/ControllerProvider/Admin/Fields.php @@ -28,7 +28,7 @@ class Fields implements ControllerProviderInterface, ServiceProviderInterface $app['vocabularies'] = $app->share(function (PhraseaApplication $app) { $vocabularies = new \Pimple(); - $vocabularies['User'] = $vocabularies->share(function () use ($app) { + $vocabularies['user'] = $vocabularies->share(function () use ($app) { return new UserProvider($app); }); diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Admin/FieldsTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Admin/FieldsTest.php index 423b10966f..8e10b1842c 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Admin/FieldsTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Admin/FieldsTest.php @@ -181,7 +181,7 @@ class FieldsTest extends \PhraseanetAuthenticatedWebTestCase $body[count($body) - 1]['readonly'] = true; $body[count($body) - 1]['required'] = false; - $response = $this->request("PUT", sprintf("/admin/fields/%d/fields", $databox->get_sbas_id()), [], [], [], json_encode($body)); + $response = $this->request("PUT", sprintf("/admin/fields/%d/fields", $databox->get_sbas_id()), [], [], json_encode($body)); $this->assertEquals("application/json", $response->headers->get("content-type")); @@ -230,7 +230,7 @@ class FieldsTest extends \PhraseanetAuthenticatedWebTestCase 'vocabulary-restricted' => true, ]); - $response = $this->request("POST", sprintf("/admin/fields/%d/fields", $databox->get_sbas_id()), [], [], [], $body); + $response = $this->request("POST", sprintf("/admin/fields/%d/fields", $databox->get_sbas_id()), [], [], $body); $this->assertEquals("application/json", $response->headers->get("content-type"));