Hi Maintainer,
Im testing beta_3 on a 5.3 installation and found some problems.
1. If I install private_upload i got a lot of erroes becaue opendir, closedir, is wrong.
2. I created the folder private by myself in the files dir. I Created the .htaccess ok.
my actual status:
* Public File Folder: 'files'
* Private File Folder: 'files/private'
*
files/private is writable. Great.
*
Not able to test the security of your private directory (files/private). Either the directory is empty or you are using PHP4.
*
You have an .htaccess file in private folder. Great.
*
File download method is set to public. Great.
*
There are no old-style private files hanging around. Great.
*
There are '0' files in the private folder, and the DB thinks there are '0' private files. Great.
* There are no public files attached to private nodes. Great.
* Uploaded files in db: '19' files attached to '9' nodes.
But if I upload a file and check the private checkbox, the file is stored in the normal file dir not in the files/private folder.
So do what I have to do?
Dirk
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | private_upload_weight.patch | 2.6 KB | starbow |
| #15 | private_upload.install | 639 bytes | iokevins |
Comments
Comment #1
starbow commentedwhat do you mean:
1. If I install private_upload i got a lot of erroes becaue opendir, closedir, is wrong?
Comment #2
designwork commentedHi strabow,
after installing i got the warning (if I remember right), that opendir and closedir are not known commands...
But I can test it again!!!
My main problem is that even if i flag a file as private its not stored in the dir files/private but in the normal files dir.
Dirk
Comment #3
starbow commentedIf your system doesn't know about opendir:
http://us.php.net/manual/en/function.opendir.php
and closedir:
http://us.php.net/manual/en/function.closedir.php
it's kind of surprising that any of the file handling code works at all.
Comment #4
designwork commentedHi starbow,
ok i deleted everything and strated again. Going to admin/settings/private_upload i got hte following message:
* warning: opendir(files/private) [function.opendir]: failed to open dir: No such file or directory in /kunden/163565_20459/webseiten/dirksway/modules/private_upload/private_upload.module on line 118.
* warning: readdir(): supplied argument is not a valid Directory resource in /kunden/163565_20459/webseiten/dirksway/modules/private_upload/private_upload.module on line 119.
* warning: closedir(): supplied argument is not a valid Directory resource in /kunden/163565_20459/webseiten/dirksway/modules/private_upload/private_upload.module on line 125.
* warning: opendir(files/private) [function.opendir]: failed to open dir: No such file or directory in /kunden/163565_20459/webseiten/dirksway/modules/private_upload/private_upload.module on line 416.
* warning: readdir(): supplied argument is not a valid Directory resource in /kunden/163565_20459/webseiten/dirksway/modules/private_upload/private_upload.module on line 417.
* warning: closedir(): supplied argument is not a valid Directory resource in /kunden/163565_20459/webseiten/dirksway/modules/private_upload/private_upload.module on line 422.
Ok i made my folder private in the dir. files.
Now I have the following status:
* Public File Folder: 'files'
* Private File Folder: 'files/private'
* files/private is writable. Great.
* Not able to test the security of your private directory (files/private). Either the directory is empty or you are using PHP4.
* You have an .htaccess file in private folder. Great.
* File download method is set to public. Great.
* There are no old-style private files hanging around. Great.
* There are '0' files in the private folder, and the DB thinks there are '0' private files. Great.
* There are no public files attached to private nodes. Great.
* Uploaded files in db: '19' files attached to '9' nodes.
I created a new article uploaded a file witch is set to private. I saved the article. But the attached file is now in the folder files not in the folder files/private.
What did I wrong?
Dirk
Comment #5
starbow commentedHave you checked your admin/logs/status page? I suspect there is something up with your 'files' directory.
Comment #6
designwork commentedHi starbow,
yes i checked it look at my status:
Drupal 5.5
Cron-Wartungsaufgaben Zuletzt vor 1 Minute 47 Sekunden ausgeführt
Cron kann per Hand ausgeführt werden.
Dateisystem Beschreibbar (öffentliche Download-Methode) >> public
Datenbankschema Aktuell
Konfigurationsdatei Geschützt
MySQL-Datenbank 5.0.45
PHP 5.2.4
Private Upload Security of private directory is unknown.
Not able to test the security of your private directory (files/private). Either the directory is empty or you are using PHP4.
Unicode-Bibliothek PHP mbstring-Erweiterung
Webserver Apache/1.3 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.8f AuthPG/1.3 FrontPage/5.0.2.2635
I´m not shure what could be wrong?
Dirk
Comment #7
starbow commentedCan you give beta4 a try? It has some improved status testing methods that might give me more information.
Comment #8
designwork commentedHi Strabow,
it tested beta3 again today on a clean install of 5.5 and got the same problems. I will have a look at the code today.
Ps i will only work with verison beta4 OK
Dirk
Comment #9
designwork commentedHi Strabow,
I tried everything with beta4 and now i got the following warning after attaching a file to a node "Private Upload: Private checkbox not in form.". The file is still stored in the main files dir. not in files/private.
My Status is:
* Public File Folder: 'files'
* Private File Folder: 'files/private'
* files/private exists and is writable. Great.
* You have an .htaccess file in private folder. Great.
* Your private folder is not accessable. Great!
* File download method is set to public. Great.
* There are no old-style private files hanging around. Great.
* There are '0' files in the private folder, and the DB thinks there are '0' private files. Great.
* There are no public files attached to private nodes. Great.
* Uploaded files in db: '1' files attached to '1' nodes.
I´m running the same MySQL and PHP config like above.
So whats going on?
Dirk
Comment #10
iokevins commentedHi,
On submit or preview of a form, I also receive the "Private Upload: Private checkbox not in form." error. I'm running a relatively new install of 5.5 with beta4.
Function private_upload_form_validate() reports this error. I suspect function private_upload_form_alter() is not injecting the private checkbox properly--I'm learning about how the forms API works as I go here, so perhaps I can offer a fix if I stumble across the solution. I'm finding
quite useful in seeing the structure of the form for debugging purposes.
Peace
Comment #11
designwork commentedHi strawbow,
now I have one more error when I go to /admin I get the following error message: "warning: Missing argument 2 for private_upload_requirements() in /kunden/163565_20459/webseiten/freelens_2/modules/private_upload/private_upload.module on line 88."
I will check it tomorrow.
Dirk
Comment #12
starbow commented@DesignWork & schultkl: My current working theory is that if you see the "Private Upload: Private checkbox not in form." error, then there is another module that is in conflict with Private Upload. Please try disabling all your non-core modules and see if that fixes the problem for you.
Also, ignore the warning in #11. That will be gone in the next beta.
Comment #13
iokevins commentedHi Starbow,
Unchecking everything in admin/build/modules (except upload and Private Upload) failed to remove the error. I'm still investigating and I'll let you know what I find.
Peace
Comment #14
iokevins commentedHi Starbow,
Since both modules have module weight zero, module upload overrides this private_upload::private_upload_form_alter() assignment, as modules evaluate in alphabetical order:
By the time includes/form.inc::drupal_prepare_form() finishes this code:
the value set by module private_upload above is "upload_form_current".
Solution: Setting the weight of the upload module to a value less than private_upload (for example, -1) fixes this issue.
private_upload_form_validate() now displays "Hi Tao" at the top of the screen as a successful validation should.
Peace
Comment #15
iokevins commentedPer:
Howto: Update a module's weight
http://drupal.org/node/110238
I've created a file implementing hook private_upload_install() for updating table system when the module is installed. Alternatively, you might incoporate it into private_upload.module.
Peace
Comment #16
iokevins commentedComment #17
starbow commented@DesignWork: Ok, I have committed a variation on schultkl's patch to beta5. Please give that a try (be sure to visit the status page to trigger the weight change). I am a little dubious, but if this fixes it, great.
Comment #18
designwork commentedHi All,
I tested the beta4 with the new install and I have the same problems. Nothing changed!!! Just to correct I have a clean install 5.5 with no contrib modules exept private_upload.
Describing the stuff. Creating a node and attching a file shows first the core upload theme function only after attaching a file I see the private_upload theme function with the private checkbox. Saving the node brings me back to the core theme function. If I edit the node again under files attachments I see the core function again the private checkbox is not there!
should be the hook_form_alter.
Lets start here.....
Dirk
Comment #19
starbow commentedPlease try this with beta5. Let's see if it is a module weight problem.
Actually, if you can, please apply this patch - it should have better error messages. If you can't apply this patch, be sure to visit /admin/settings/private_upload before retesting.
Thanks.
Comment #20
iokevins commentedHi Starbow,
At 12:07 PST, I'm unable to download beta5:
Also, a minor change suggestion--bug 202235 in the release notes:
fixed the case when multiple roles have access to a node with a file attachment.
Peace
Comment #21
iokevins commentedHi Starbow,
I tested this patch and it seems to resolve the problem. After visiting admin/settings/private_upload I see the message:
When I visit the private node, I immediately see the private checkbox in the File Attachments area.
BTW--the second chunk of the patch looks strange to me:
It seems backwards--it seems to me the patch should add (+) the core upload.module check. I'm relatively new to patching so perhaps I'm confused in this instance.
Peace
Comment #22
iokevins commented@DesignWork
You're describing the same problem I had.
If you're willing and able, please find table system in your database. Look at the weights for records "private_upload" and "upload" (last column). Record private_upload should have a weight that's greater than record upload. If not, please change record private_upload to have a greater weight than record upload. Finally, revisit the node with the error.
Please let me know if that fixes the problem.
It seems you may have tested with beta4, which does not correct the problem. Beta5 doesn't seem to be available just yet but should correct the issue.
Peace
Kevin
Comment #23
starbow commentedWeird that beta5 isn't showing up. I rolled in the patch and did another released as beta6, but it's not showing up yet either. Hmm, I bet the packaging system is just running slow today. If you are chomping at the bit, you can pull a copy of the most recent code from: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/private_upl...
(Update: the beta packages just showed up).
@schultkl: You are right about the math being wrong in #21. In a patch, any line that starts with '-' is being removed, and any line that starts with '+' is being added. So the lines with the bad math are being removed by the patch.
Comment #24
iokevins commentedHi Starbow, DesignWork,
I just installed a new instance of Drupal 5.5 and module private_upload beta6, and everything works as expected.
Hoping this resolves your issue.
Peace
Comment #25
designwork commentedHi schultkl,
yes i installed the beta6 version and it worked. Look at my system table and private_upload has weigth1 upload has weight 0. But on a clean install i still got the opendir. error message like above if the folder private is not in the files dir.. So I will change that.
Dirk
Comment #26
iokevins commentedThat's wonderful news Dirk. Wishing you continued success.
Kevin
Comment #27
starbow commentedgreat
Comment #28
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.