Validation failed while trying to call showAction
Asked Answered
D

1

8

I am using TYPO3 7.6.11 and getting the following error when I am trying to call showAction().

Validation failed while trying to call Vendor\Extension\Controller\MyController->showAction().

I've already checked the validation in the model and couldn't find any issues.

Is there a way to debug this error and get more information?

Downswing answered 13/11, 2016 at 9:3 Comment(0)
T
9

You can either debug the validation results or display them in your template.

Debugging the validation results

For debugging have a look in the \TYPO3\CMS\Extbase\Mvc\Controller\ActionController that your controller extends. You'll find the method callActionMethod() where the validation results are processed.

Displaying the validation results

For displaying the errors in fluid, use the ViewHelper <f:form.validationResults>:

<f:form.validationResults>
  <f:if condition="{validationResults.flattenedErrors}">
    <ul class="errors">
      <f:for each="{validationResults.flattenedErrors}" as="errors" key="propertyPath">
        <li>{propertyPath}
          <ul>
          <f:for each="{errors}" as="error">
            <li>{error.code}: {error}</li>
          </f:for>
          </ul>
        </li>
      </f:for>
    </ul>
  </f:if>
</f:form.validationResults>
Tetragrammaton answered 13/11, 2016 at 11:9 Comment(3)
Thank's alot! I am getting 7 informations like this one: extbase/Classes/Validation/ValidatorResolver.php:118 -> Validator class Vendor\Extension\Domain\Validator\BewertungenValidator does not exist. All of these fields do not have any validation. The only thing they have in common is, that these fields are realations. Do you have any idea what the problem could be?Downswing
Not without seeing your code (the showAction and the model(s).Tetragrammaton
Hi Daniel, thank's for your answer. I've figured out where the error comes from. It's related to jh_captcha. I've implemented jh_captcha to my domain modell as described docs.typo3.org/typo3cms/extensions/jh_captcha/Developer/…. The validation causes the issue: @validate NotEmpty, \Haffner\JhCaptcha\Validation\Validator\ReCaptchaValidator - showAction works after removing the validation line - but creating a new object doesn't check the captcha anymore, obviously.Downswing

© 2022 - 2024 — McMap. All rights reserved.