I'm pretty sure this is a bug report, rather than a "users" question. (Also this question has gone unanswered on the users list before, I've gone back and looked.)
The sfWidgetFormInputFileEditable class is tantalizing but it's far from clear how to make it work. There is no documentation of how to use it. When you first add this widget you get an error saying that you need a file_src option. I'm guessing here, but I assume that is the path to the existing version of the file. The file system path, otherwise the "delete" option couldn't possibly work. Okay, so I specify that. Now this complete path shows up in the page, which is a big no-no (revealing information about my server's file system to the user = bad plan). I'm shown the path to the existing file, a browse button (presumably to replace it if I want), and a checkbox to delete the existing file (I guess this is for the case in which I want to have no file selected at all at the end of the process). If I submit the form at this point, I get an error complaining that I have not selected a new file, even though keeping the existing one when I don't do that is (again, presumably...) the whole point. I'm told that I need to add a validator for the delete checkbox (although not what kind). Okay, it's a boolean, I can see that. So I add that. There is no impact on the problem that I'm still flunking the file validator. Jobeet doesn't use this class, and there is no tutorial or deeper documentation on it anywhere. The naming of the delete widget doesn't make sense. Since it's named file_delete (if my original widget is named file), rather than, say, file[delete], there is no way for a single validator to get the job done by looking at both input fields (I learned how that can be accomplished by looking at sfValidatorDate). This thing could work, almost as designed, if there were an sfValidatorFileEditable class that takes the same "existing filename" option as the widget, and if the file widget and delete widget were named basename[file] and basename[delete] (where basename is the name the widget is given). Then the validator could delete the existing file if needed, tolerate the lack of a replacement because an existing file is already there, etc. And a separate option is needed in the widget class for the web path to the file so it can be downloaded (or viewed, if it's an image, which seems to be supported to some extent)... In other words I'm pretty sure this is just unfinished code and didn't really belong in the core release. Am I missing something? -- Tom Boutell www.punkave.com www.boutell.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en -~----------~----~----~----~------~----~------~--~---
