I need filestore2 working in 4.7, so I took the cvs and figured I could make it work. It was 90% converted to 4.7. I have corrected several bugs but have hit the wall with this. The field fsid is not getting set in the db record. If I amend the db manually, everything is good. My debugging tells me that $node->fsid disappears between validate and insert. Other fields (eg url) are fine. The only thing different about fsid is that it is a hidden field on the form because the user has no need to know about it, it is the record number in fscache. I have read the conversion notes for 4.7 and nothing mentions hidden fields. Maybe someone can flick the light on for me. Am happy to give the working module back to Gordon and/or the community, but at the moment am frustratingly stuck.
Paul
Comments
4.7 Forms
Take a look at the Quickstart (http://api.drupal.org/api/4.7/file/developer/topics/forms_api.html) and Reference (http://api.drupal.org/api/4.7/file/developer/topics/forms_api_reference....) for 4.7 Forms.
4.6 used to use form_hidden() function
4.7 would look like this
Could you post the code you are using for the FORM. A "dprint_r($_POST['edit'])" after the form is posted would also be useful.
Got it working
with a horrible global variable, yuk. Thanks for the posting, I have read those quickstart and reference. I probably jumped to wrong conclusion about the hidden field, it just seemed something "different" and a likley suspect. I guess the field is getting clobbered somewhere? The parts of the module converted to 4.7 work fine, there seems to be some cruft there still in 4.6 forms mode, it obviously is never executed.
I like filestore2. it does what I want for file and resource downloads with version and download count. It seems Gordon is not keen on continuing with it, are there any alternative modules?
If anyone wants what I have got, they can PM me.
www.scryptik.com - Javascript editor with syntax error checking
www.purpleoar.co.nz/scryptik - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy
Need to use hook_submit
Since filestore2_validate() in 4.7 is only used for validating and can no longer change values of $node you should probably create filestore2_submit() and move these two lines of code there.
This new feature is even mentioned in converting 4.6 modules to 4.7. Nice to finally find it someplace after spending couple of days figuring it out the hard way. API docs still give the wrong info here.
Hope this helps.
Markko