public function errorAction() {
		$validationResults = $this->arguments->getValidationResults()->getFlattenedErrors();
		$result = array();
		/** @var \Neos\Error\Messages\Error  $validationResult */
		foreach ($validationResults as $key => $validationResult) {
			/** @var \Neos\Flow\Validation\Error $error */
			foreach ($validationResult as $error) {
				// Check Current Package Validation Errors
				$translatedMessage = $this->translator->translateById($error->getCode(), $error->getArguments(), NULL, NULL, 'ValidationErrors', $this->request->getControllerPackageKey());

				// Check Flow Validation Errors
				if ($translatedMessage === $error->getCode()) {
					$translatedMessage = $this->translator->translateById($error->getCode(), $error->getArguments(), NULL, NULL, 'ValidationErrors', 'Neos.Flow');
				}

				// Use default error message
				if ($translatedMessage === $error->getCode()) {
					$translatedMessage = $error->render();
				}

				$result['errors'][$key][] = array(
					'code' => $error->getCode(),
					'message' => $translatedMessage
				);
			}
		}
		$result['success'] = FALSE;
		$this->view->assign('value', $result);
		$this->response->setStatus(400);
	}
public function errorAction() {
		$validationResults = $this->arguments->getValidationResults()->getFlattenedErrors();
		$result = array();
		/** @var \Neos\Error\Messages\Error  $validationResult */
		foreach ($validationResults as $key => $validationResult) {
			/** @var \Neos\Flow\Validation\Error $error */
			foreach ($validationResult as $error) {
				// Check Current Package Validation Errors
				$translatedMessage = $this->translator->translateById($error->getCode(), $error->getArguments(), NULL, NULL, 'ValidationErrors', $this->request->getControllerPackageKey());

				// Check Flow Validation Errors
				if ($translatedMessage === $error->getCode()) {
					$translatedMessage = $this->translator->translateById($error->getCode(), $error->getArguments(), NULL, NULL, 'ValidationErrors', 'Neos.Flow');
				}

				// Use default error message
				if ($translatedMessage === $error->getCode()) {
					$translatedMessage = $error->render();
				}

				$result['errors'][$key][] = array(
					'code' => $error->getCode(),
					'message' => $translatedMessage
				);
			}
		}
		$result['success'] = FALSE;
		$this->view->assign('value', $result);
		$this->response->setStatus(400);
	}
public function errorAction ( ) { $ validationResults = $ this -> arguments -> getValidationResults ( ) -> getFlattenedErrors ( ) ; $ result = array ( ) ; /** @var \Neos\Error\Messages\Error  $validationResult */ foreach ( $ validationResults as $ key => $ validationResult ) { /** @var \Neos\Flow\Validation\Error $error */ foreach ( $ validationResult as $ error ) { // Check Current Package Validation Errors $ translatedMessage = $ this -> translator -> translateById ( $ error -> getCode ( ) , $ error -> getArguments ( ) , NULL , NULL , 'ValidationErrors' , $ this -> request -> getControllerPackageKey ( ) ) ; // Check Flow Validation Errors if ( $ translatedMessage === $ error -> getCode ( ) ) { $ translatedMessage = $ this -> translator -> translateById ( $ error -> getCode ( ) , $ error -> getArguments ( ) , NULL , NULL , 'ValidationErrors' , 'Neos.Flow' ) ; } // Use default error message if ( $ translatedMessage === $ error -> getCode ( ) ) { $ translatedMessage = $ error -> render ( ) ; } $ result [ 'errors' ] [ $ key ] [ ] = array ( 'code' => $ error -> getCode ( ) , 'message' => $ translatedMessage ) ; } } $ result [ 'success' ] = FALSE ; $ this -> view -> assign ( 'value' , $ result ) ; $ this -> response -> setStatus ( 400 ) ; }
Return validation results as json
Return validation results as json