ZF2-305: Zend\File\Transfer\Adapter\AbstractAdapter setTranslator


When using an Adapter for a form Translator (e.g ArrayAdapter), if applying to a File Element, it fails with: Exception caught by form: Invalid translator specified and the form is not rendered.

After debugging this issue I found the problem at line 1101 of Zend\File\Transfer\Adapter\AbstractAdapter.php in function setTranslator

this reads:

} elseif ($translator instanceof AbstractAdapter) {

this makes no sense offcurse, it should read:

} elseif ($translator instanceof Translator\Adapter\AbstractAdapter) {

after fixing this line, the form with the file element will display fine with the translation working as expected.

Regards, Paulo


Hi Paulo,

If you want you can send a Pull Request directly to GitHub (

You can find more info here…


Finally I made the changes because they are a little different from your proposal.