Search code examples
typo3typo3-7.6.xtypo3-8.xtypo3-extensions

How to debug `Validation failed while trying to call showAction` in another extension in TYPO3


I am getting Validation failed while trying to call showAction in another extension, but due to an extension I developed. Now I dont know where / how to debug the issue. Something tells me it should be in the setup.txt

Is it possible that my extension is somehow conflicting with this other extension? Because if my extension is deactivated then this error disappears. So then how do I debug where the problem could be in my extension?


Solution

  • This error is occuring when a model which is handed over as parameter is not valid.

    E.g. public function showAction(\Vendor\ExtName\Domain\Model\MyClass $myClass), Extbase tries to validate the model $myClass.

    You can either look why the model is not valid (preferred way) or you can say Extbase to not validate the class by adding @ignorevalidation $myClass to the function header:

    /**
     * @param \Vendor\ExtName\Domain\Model\MyClass $myClass
     * @ignorevalidation $myClass
     */
    public function showAction(\Vendor\ExtName\Domain\Model\MyClass $myClass)
    {
        ...
    }
    

    When you want to look for the possible invalid entry you need to check the code of the model. More you can find here: https://docs.typo3.org/typo3cms/ExtbaseFluidBook/9-CrosscuttingConcerns/2-validating-domain-objects.html