Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validation failed while trying to call showAction

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?

like image 708
lufi Avatar asked Nov 13 '16 09:11

lufi


1 Answers

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>
like image 197
Daniel Avatar answered Nov 10 '22 13:11

Daniel