by Aaricia Thorgalson (aka Mari Cruz García).
Thanks, Davo, but I don't think it is the Moodle version, if I try the same code of /mode/assignment in a different database is working fine an saving and displaying the files.
I have two Moodle sites 2.2.4 both was working fine until the production site start to show this behaviour, the development site works fine, but if I install the database of the Moodle site in the development site, the bug appears.