0

I'm working on a site where someone did a lot of security updates. After reviewing the site, we found a bug. When you try creating a node with a file upload, when you click the save button, instead of saving it actually downloads the file to your computer. I'm not really sure where to start looking for this issue.

Has anyone had this issue before?

7
  • does it actually upload properly prior to the save if you 'choose' and then 'upload'?
    – Geoff
    Feb 24, 2015 at 19:15
  • yes it does, thats what makes it weirder. It clearly has the correct permissions etc to upload properly Feb 24, 2015 at 19:32
  • that is weird - I would suggest disabling modules one by one to see if it's actually a module causing the problem - disable (not uninstall) everything in sequence not directly required for that one page to function as intended (on a dev copy of course)
    – Geoff
    Feb 24, 2015 at 19:57
  • Ok found out one more thing: If after I upload i uncheck 'Include File in Display', the it saves ok. I searched for that text and found that its set by the core file module.... Does this help? Feb 24, 2015 at 20:46
  • if you don't need that functionality, you can turn it off in the field settings - temporary, but might be a viable option for now. Does the node save after the file downloads, or does the page change at all?
    – Geoff
    Feb 24, 2015 at 20:53

1 Answer 1

0

I found the issue. I found this stuck in the node template:

<?php if (!empty($node->field_white_paper_file['und'][0])){
  drupal_goto(file_create_url($node->field_white_paper_file['und'][0]['uri']));
 }?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.