Error when calling endpoint with default language in strict mode
When I call an endpoint in default language, an error is thrown:
#1644319953 Error
Argument 1 passed to TYPO3\CMS\Core\Site\Entity\Site::getLanguageById() must be of the type int, string given, called in /Users/rainerbecker/GIT/tui-robinson---V9/app/html/typo3conf/ext/nnrestapi/Classes/Controller/ApiController.php on line 61
I think the reason is, that in https://bitbucket.org/99grad-team/nnrestapi/src/90713711c86351535b6cfa7dcdfa5add2dd35219/Classes/Mvc/Request.php#lines-178 a string is returned instead of an integer in case the languageId was found.
Comments (4)
-
-
reporter Yes, that fixes the problem.
At least for TYPO3 v9 it seems that the languageId is written to site configuration as string when editing it in the BE and press save. -
Great – thanks for testing.
Will be in the next release! -
- changed status to resolved
- Log in to comment
Thanks for reporting!
This could have to do with the way the languageId is defined in your site config yaml.
Could you try replacing line 178 with the following code?
Does that solve the problem?