Closed (fixed)
Project:
Private Upload
Version:
5.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2007 at 04:11 UTC
Updated:
23 Jul 2008 at 10:56 UTC
I found a problem when re-enabling Private Upload to help troubleshoot #197154. For some reason all uploads are public by default, even with the "Default Upload Privacy Setting" set to "private". The uploads are still public by default even after resetting the Private Upload settings with its "Reset to defaults" button -- and I reinstalled Private Upload with the Devel module, too, to no effect.
To make the uploaded file private in the test at #197154, I checked the "private" checkbox in the "File attachments" fieldset when editing the node.
Comments
Comment #1
starbow commentedI haven't been able to reproduce this issue. Can you try it out again on a system without all the other upload enhancement modules?
Comment #2
Christefano-oldaccount commentedsure, I'll do that later tonight. This issue, by the way, was reproduceable when all other upload enhancement modules were disabled.
Comment #3
grahamgilchrist commentedI am finding the same issue. The module worked ok first time, ticking the 'private' box on the node form and the file was sent to the right directory. Now, though, the module keeps reverting to the public upload url of 'files/filename.doc' rather than 'files/private/filename.doc' no matter whether the tickbox is checked or not.
I don't know what I did in between to confuse it?
Comment #4
Christefano-oldaccount commentedgrahamgilchrist, which version of Private Upload are you using?
Comment #5
grahamgilchrist commentedI am using the latest one I could find on the drupal site: 5.x-1.0-beta3
Comment #6
starbow commentedAre you guys using PHP4 or 5?
Comment #7
grahamgilchrist commentedI am using PHP 5.
I think my issue might be slightly different though. I see the private checkbox when doing a javascript attach (when submitting) but not when viewing the page normally to edit after.
I have been doing some debugging on this issue because I really need it working for a site I am working on. It seems for me basically that the "_theme_private_upload_form" routine is not triggering, hence defaulting to the upload.module theme and not showing the private checkbox and not setting the private flag properly, meaning everything is saved as public.
I have a feeling it might be something in this line:
$form['attachments']['wrapper']['files']['#theme'] = 'private_upload_form';not setting to the right part of the form in the "private_upload_form_alter" function, but I could be way off with this.
I thought perhaps also it is the upload.module interfering. if two modules are trying to theme the same bit of form, which one gets preference?
Comment #8
Christefano-oldaccount commentedPHP5 here.
Comment #9
starbow commented@grahamgilchrist: I think you are having a different issue than christefano. I suspect you have a different module that is attempting to theme the file attachments form. In general, it is the last module that wins in attempts to theme forms. My module goes after upload.module, but before upload_image.module (for example). Please uninstall all contributed modules that have to do with file upload. If the problem still persists, please open a new issue. Thanks.
Comment #10
starbow commented@christefano: I still haven't been able to reproduce this issue. I need a step-by-step on how to trigger it.
Comment #11
iokevins commented@grahamgilchrist: You correctly guessed the cause of the problem--modules execute based on module weight, then alphabetically within the same module weight. See documentation of parameter "param" for includes/module.inc::module_list(), which is called by includes/module.inc::module_invoke_all(), which is called by includes/form.inc::drupal_retrieve_form().
Please see http://drupal.org/node/200537 for additional info and install beta6 to resolve your issue.
@christefano: I believe the above issue also caused the problem you reported--I saw the same symptoms.
That is:
* edit page node
* no private checkbox
* attach file
* javascript runs, progress bar shows, private checkbox appears
* check private checkbox
* click button Preview
* no private checkbox
* click button Submit
* file ends up in public files directory
Same result happened if I clicked button Submit without going through Preview first.
After installing beta6, everything works as expected. I believe the private checkbox wasn't injected properly into the form, which caused the file not to get migrated properly into the private directory.
Peace
Comment #12
starbow commentedComment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.