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
Posted by Maks 3w (maks3w) on 2012-05-17T11:12:09.000+0000
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.
Posted by Maks 3w (maks3w) on 2012-05-17T11:35:22.000+0000
Finally I made the changes https://github.com/zendframework/zf2/pull/1246 because they are a little different from your proposal.
Posted by Maks 3w (maks3w) on 2012-05-18T16:38:15.000+0000
Fixed