The recent change in the validattion of node input broke uploading of files. It seems to me that introducing case 'execute' before case 'validate' in upload_nodeapi is at least a partial fix.

CommentFileSizeAuthor
#4 upload_8.patch628 byteskilles@www.drop.org

Comments

killes@www.drop.org’s picture

Status: Active » Needs review

here's a patch.

eaton’s picture

Works here, too. I'm pretty sure a nice validation/execution/insertion refactoring needs to happen at some point, but this fixes the basic 'can't upload stuff' issue.

+1

Tobias Maier’s picture

where's a patch?
cant see one...

killes@www.drop.org’s picture

StatusFileSize
new628 bytes

Hmm, were did the patch go?

dries’s picture

Eaton?

eaton’s picture

How bizarre. I saw the first version he uploaded, too. http://drupal.org/files/issues/upload_8.patch works though.

Souvent22’s picture

Patched, and upload, list, delete, reupload, it all works now. +1

m3avrck’s picture

Status: Needs review » Reviewed & tested by the community

Ok at least files can be uploaded now ... still other bugs to fix that are related :-D

dries’s picture

I'm wondering if we can't fix this properly. The current solution is somewhat hairy and doesn't make for good example code. Would it be a lot of work, or does someone has the time to look into this?

killes@www.drop.org’s picture

Status: Reviewed & tested by the community » Needs work

I did not really intend this patch to go into core, it is merely a workaround. The proper solution is to rewrite the validation part, I think. unfortunately i don't have the time to look at it. :(

m3avrck’s picture

Dries I was looking at the code too but I'm not sure exactly what would need to change. Reason being, when you 'validate' the upload on say a node preview, upload needs to actually upload the file to make sure space requirements are met, valid extension, etc... then on execute, it almost needs to verify all of this again, just to make sure the file wasn't maliciously changed or anything. With that, I don't see this as being too hairy of a solution. However, perhaps some of the code could be broken up? I'm not exactly sure what can and can't though...

m3avrck’s picture

Status: Needs work » Closed (duplicate)

See this patch for an update to this one: http://drupal.org/node/39358

Steve Dondley’s picture

Status: Closed (duplicate) » Fixed

Uploads working now. Likely fixed per patch mentioned in comment immediately above.

dries’s picture

Status: Fixed » Closed (fixed)