I am having a problem, if I enable the Private Message File Attachments part of this module and grant correct permissions, if I go to add a file to a private message, I get the following text:
File attachments are disabled. The file directories have not been properly configured. Please visit the file system configuration page.
However, the file system is configured correctly, as the file attachments work everywhere else just fine.
I am using the latest 6.x version of Drupal and the latest dev version of this module.
Thanks,
JB
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | privatemsg_file_attachments_descriptions_changes2.patch | 2.23 KB | berdir |
| #8 | privatemsg_file_attachments_descriptions_changes.patch | 2.36 KB | imatechie |
| #6 | Description_Modifications.zip | 43.28 KB | imatechie |
Comments
Comment #1
berdirThat message is displayed if the module can't create the specified folder where it should upload the files. Maybe you have configured a folder that isn't accessible and can't be created. The setting is admin/settings/messages in a Privatemsg attachments fieldset. What does it display there? Try setting it to empty or a folder that does exist.
Comment #2
imatechie commentedThat fixed it, I did have a path there and a corresponding folder with correct permissions, but it still didn't work, can you give a sample path that could go there??
I removed the path and it works now. The error message was a bit misleading, as it directed me to the file system configuration page of the main site and I think it should of mentioned about the settings in the module admin section instead.
Comment #3
berdirDid you use an absolate path or something like that? Right now, only a relative path (based on the global upload directory) is supported.
And yeah, you're right about updating the error message, I've just copied that from upload.module.
Comment #4
imatechie commentedAha, so your talking about a a directory off of Drupal's file attachments directory which by defualt would be:
drupal_root/sites/default/files
(Not sure about the trailing slash)
So if I was to put pm_attachments in the field set, the actual directory path would be one of the following:
drupal_root/sites/default/files/pm_attachments
drupal_root/sites/default/files/pm_attachments/
Thanks,
Jeff
Comment #5
berdirExactly, we probably need to explain that better and if possible, even provide a live preview of the resulting path and if the permissions are correct. Any suggestions are welcome!
Comment #6
imatechie commentedI'm not much of a programmer at all, and don't know anything about patch or diff files.
Anyway, in the interim, I modified the privatemsg_attachments.module file to provide a little better descriptions for the file-attachment path and the error message when the file-attachment fieldset is not configured correctly.
The changed .module file (I commented the changes) and two screen shots of the new messages are attached.
Hope you like it and that you don't mind the descriptions change.
I don't know the proper way to escape characters in Drupal, so I had to fall back on the backslash to escape an apostrophe or two.
You may want to verify that my string changes haven't broken anything else accidentally in that file. As from the screen shots, it looks OK.
Replace the privatemsg_attachments.moudle file with this one.
(For others, this goes into the privatemsg_attachments directory off of the privatemsg module directory)
Jeff
Comment #7
berdirThanks for working on it, I'll check it out soon.
FYI, creating patches isn't *that* hard, see http://drupal.org/patch/create. And patches make it a lot easier to see the actual changes.
Comment #8
imatechie commentedHere is the patch for my changes in my previous comment, as stated, it simply changes the file attachment error message and links to the correct admin page if the private message file attachments are disabled due to a misconfiguration of the attachment directory fieldset in the private message administration settings.
This error message shows up when a user tries to attach a file to a private message and it isn't configured correctly.
The second change is in the administration settings for the private message module, the way the current wording is, one could think one was talking about a regular system path when they go to configure the path to the private message attachment directory.
This just changes the description here to indicate that the path is off of Drupal's main configured file attachment directory.
I am not a developer and hardly know anything about coding and this is my first patch, I did test it on my site and it worked.
Hopefully, this will make the descriptions much clearer.
Comment #9
berdirGreat, the patch per-se looks good, a few comments on the content...
Comments should only explain what's there and not the process that lead to the code. If someone else reads that comment in a year, it would make no sense at all.
I suggest to simply remove it, it's not something complex that we need to explain. Same for the comment below.
Also, the first line has a trailing whitespace, you should remove that too.
You seem to have changed the indentation of that if statement, there is no need for this patch to change this line.
Again, a few trailing whitespaces and you used tabs instead of spaces. You should always use two spaces to intend.
Generelly, you should always try to keep the patch as small as possible (and as big as necessary). In your case, only the lines with the updated #descriptions should show up as changed.
Thanks for working on this! I'm sure you'll be able to re-use what you're learning here :)
Powered by Dreditor.
Comment #10
berdirComment #11
berdirUpdated the patch.
Comment #12
berdirCommited to 6.x-2.x-dev, thanks for reporting!