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?

Daniel
  • 6,916
  • 2
  • 36
  • 47
lufi
  • 610
  • 7
  • 29

1 Answers1

7

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>
Daniel
  • 6,916
  • 2
  • 36
  • 47
  • 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? – lufi Nov 13 '16 at 12:42
  • Not without seeing your code (the showAction and the model(s). – Daniel Nov 13 '16 at 16:59
  • 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 https://docs.typo3.org/typo3cms/extensions/jh_captcha/Developer/Index.html#add-the-captcha-to-your-domain-model. 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. – lufi Nov 13 '16 at 17:05