mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
fix service lookup in lower-case
This commit is contained in:
@@ -129,7 +129,7 @@ class FieldsController extends Controller
|
|||||||
{
|
{
|
||||||
$vocabularies = $this->getVocabularies();
|
$vocabularies = $this->getVocabularies();
|
||||||
|
|
||||||
$vocabulary = $vocabularies[$type];
|
$vocabulary = $vocabularies[strtolower($type)];
|
||||||
|
|
||||||
Assertion::isInstanceOf($vocabulary, ControlProviderInterface::class);
|
Assertion::isInstanceOf($vocabulary, ControlProviderInterface::class);
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@ class Fields implements ControllerProviderInterface, ServiceProviderInterface
|
|||||||
$app['vocabularies'] = $app->share(function (PhraseaApplication $app) {
|
$app['vocabularies'] = $app->share(function (PhraseaApplication $app) {
|
||||||
$vocabularies = new \Pimple();
|
$vocabularies = new \Pimple();
|
||||||
|
|
||||||
$vocabularies['User'] = $vocabularies->share(function () use ($app) {
|
$vocabularies['user'] = $vocabularies->share(function () use ($app) {
|
||||||
return new UserProvider($app);
|
return new UserProvider($app);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -181,7 +181,7 @@ class FieldsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$body[count($body) - 1]['readonly'] = true;
|
$body[count($body) - 1]['readonly'] = true;
|
||||||
$body[count($body) - 1]['required'] = false;
|
$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"));
|
$this->assertEquals("application/json", $response->headers->get("content-type"));
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ class FieldsTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
'vocabulary-restricted' => true,
|
'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"));
|
$this->assertEquals("application/json", $response->headers->get("content-type"));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user