While trying to build my own block that allows for a file to be uploaded, I noticed that the add/edit form was not validating properly when no file was selected by the user. I copied this validation code from the built-in file block, so I tried it with the file block as well and realized that it isn't working either (same goes for the flash_content block).
The problem seems to be that the ccmValidateBlockForm function in these blocks' auto.js file are checking for a form element whose id is "ccm-b-file-value", but in fact the appropriate form element id is "ccm-b-file-fm-value". Seems that the html file helper outputs a hidden field that contains the file id, and it appends "-fm-value" to the id of the "choose a file" element, but the javascript validation code (in auto.js) is assuming it's only appending "-value" (not "-fm-value"), and hence it's not finding this DOM element and hence not validating anything.





jordanlev
patch
Note that you may need to "refresh" the blocks (via "Add Functionality" section of the dashboard) and/or clear your browser cache before this works.