]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ApiBundle/Controller/UserRestController.php
Merge pull request #4151 from ldidry/fix-4060
[github/wallabag/wallabag.git] / src / Wallabag / ApiBundle / Controller / UserRestController.php
index a1378fc54e35e522259a71ee1d190d66cc6a175f..922ab7bbb261eb7dd026e6ca2ed1fceaccfb1d00 100644 (file)
@@ -45,7 +45,7 @@ class UserRestController extends WallabagRestController
      */
     public function putUserAction(Request $request)
     {
-        if (!$this->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) {
+        if (!$this->container->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) {
             $json = $this->get('jms_serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json');
 
             return (new JsonResponse())
@@ -77,7 +77,7 @@ class UserRestController extends WallabagRestController
             $view->setFormat('json');
 
             // handle errors in a more beautiful way than the default view
-            $data = json_decode($this->handleView($view)->getContent(), true)['children'];
+            $data = json_decode($this->handleView($view)->getContent(), true)['errors']['children'];
             $errors = [];
 
             if (isset($data['username']['errors'])) {
@@ -119,7 +119,6 @@ class UserRestController extends WallabagRestController
     /**
      * Send user response.
      *
-     * @param User   $user
      * @param string $group  Used to define with serialized group might be used
      * @param int    $status HTTP Status code to send
      *