Issues

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

Description

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

Comments

Hi Paulo,

If you want you can send a Pull Request directly to GitHub (https://github.com/zendframework/zf2)

You can find more info here http://framework.zend.com/wiki/display/…

Regards.

Finally I made the changes https://github.com/zendframework/zf2/pull/1246 because they are a little different from your proposal.

Fixed