I need this functionality for users in a work-flow environment. I know this was addressed before with 5.x-1.8 and I applied the patches but all I get are error messages when sending a message with an attachment. Can someone please help?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hugafish’s picture

I agree, I need this functionality too. In todays world with community websites where in my case a lot of real time collaboration is occurring it is also nice to just send a PM with a small attachment to it as a quick file to the collaborators. I too used the patch for an earlier version and received PHP errors I think these errors were related to the version of PHP that my host is using. So this is something that will probably have to be upgraded along with this feature if they decide to implement it. Update status on this would be nice to hear about, the last post was from back in April 2008 and no word still anywhere. Maybe someone could develop an add on module for this that will be supported through version 5 and 6 etc. There are probably lots of people who would love to have this feature.

litwol’s picture

I will gladly apply this patch to d5 branch if some one provides it, however i personally will not work on it. my focus is on d6. i will definitely include this useful functionality in d6 at some point.

Jim Ruby’s picture

Hi, I need this as well, but in d6. Would you have any kind of time frame so I may have an idea when to look for it.
Thank you.

litwol’s picture

Status: Active » Postponed (maintainer needs more info)

does anyone intend to work on this or sponsor it's development ?

Berdir’s picture

Again, maybe after #288183: Provide api function for other modules to send messages.. An API should make it possible to do this as a submodule (Change Form -> add validate hook -> add submit hook)

hugafish’s picture

Wonderful news Berdir, I see that this is actively being discussed as far as I have read on the #288183 reference you mentioned. And at sometime following the API solution would be an attachment feature as a submodule possibly, I'm sure lots of people will be happy for this one. Thanks for responding and clearing this up.

Eric

Berdir’s picture

Status: Postponed (maintainer needs more info) » Needs work
FileSize
8.09 KB

Attached is a first version of the privatemsg_attachments submodule. It does depend on the newest patch in #288183: Provide api function for other modules to send messages..

It is actually a very similiar to upload, I am using the same theme functions and it does work like upload.

Features:
- multiple files
- reply and new message form is supported
- messages are displayed below the message body
- attachments are deleted when alle recipients delete the message

Important:
- As soon as the message is sent, attachments are read-only, just like the messages too.
-This is not yet ready, there are some open issues, see the api issue. But it works, atleast for me, so try it out and report if it does work for you.

We currently have pm_xy and privatemsg_xy submodules, privatemsg_attachments is very long, should I rename it to pm_attachments ?

hugafish’s picture

Will your patch work on Privatemsg 5.x-3.0, this is the version I am using. I have never been able to get patches to work for some reason, not very skilled with this sort of thing. Do I apply the patch to my existing version and then just extract your privatemsg_attachments.zip files into the privatemsg module folder root ? Also what version of PHP is required my host is still on 4.4.4. Appologize for the noob ?'s

Thanks
Eric

NaheemSays’s picture

Version: 5.x-3.0 » 6.x-1.x-dev

The patches etc are currently for the Drupal 6 version of privatemsg - chances of new features for the drupal 5 version are nil to zero unless someone else steps up to the table. The code bases are very different.

hugafish’s picture

ok thanks, it's not that critical. I will just wait until I am ready to move into version 6 and install it then.

Jim Ruby’s picture

I am not good at applying patches, can I grab the latest snapshot, would that have the latest attachment code? or would someone be able to attach a patched version of the module for me to download?
Thank you.

Berdir’s picture

Status: Needs work » Needs review
FileSize
7.99 KB

Here is the updated version. Only technical changes to get it working with the latest version of the API patch.

To install it, download the latest patch (or the zip of changed files) of #288183: Provide api function for other modules to send messages., apply/unzip it and then unzip the privatemsg_attachments.zip into the privatemsg folder and active the module.

Please report any issues you can find.

velo’s picture

Version: 6.x-1.x-dev » 5.x-3.0

Okay, enough is enough, how much cash are asking to add this functionality to version 5.x-3.0?

The support and modules for Drupal 6 are no where near ready for a production site.

litwol’s picture

@Berdir, nbz: ping me on IRC to discuss this patch. thanks :)

NaheemSays’s picture

Version: 5.x-3.0 » 6.x-1.x-dev

Does thsi need to be updated for any further updates to the api patch?

Also, this may be a stupid question but line 56:

function _privatemsg_upload_form($files = array()) {

ANy reason that that is not _privatemsg_attachments_upload_form ?

litwol’s picture

@velo: Unfortunately there are no developers available/interested in working on the d5 functionality. If you wish to see d5 version of this functionality then you should hire a developer to implement it. Perhaps do it in privatemsg issue queue because some developers here are already familiar with the d5 version of the module.

Clint Eagar’s picture

After installing the attachment module I'm getting this error.

user warning: Table 'xxxxx_dev.pm_index' doesn't exist query: SELECT DISTINCT pm.author, u.name FROM d6_pm_message pm INNER JOIN pm_index pmi ON pm.mid = pmi.mid INNER JOIN d6_users u ON pm.author = u.uid WHERE pmi.uid = 5 AND u.uid > 0 ORDER BY u.name in /home/xxxxxx/public_html/dev/sites/all/modules/privatemsg/privatemsg_filter/privatemsg_filter.module on line 203.
Berdir’s picture

Status: Needs review » Needs work

The error is not related to the module, it's a bug in privatemsg rc2. You need to upgrade to the -dev version, replace "pm_index" with "{pm_index}" on the mentioned line or wait for a rc3 release.

However, the module needs to be rerolled and will not work in the current version.

Clint Eagar’s picture

Status: Needs work » Needs review

module seems to work but when I log in as the user I sent the PM too, there are no files visible.

Berdir’s picture

Status: Needs review » Needs work

Yes, there were some changes in the api patch and this module needs to be changed to work with the version which was commited.

Berdir’s picture

Assigned: velo » Unassigned
Status: Needs work » Needs review
FileSize
15.46 KB

Re-roll of the module.

@litwol: You were right, we don't need the #privatemsg_message stuff, I can store the data in storage. However, we do need to add the content of $form_state['storage'] to $message so that modules can access the data they stored there when a message is sent. It might be possible to hack around this by loading the form out of the cache in the _insert function, but this seems ugly to me and would not work with programatically created nodes*

Changes:
- Changed $cached_form['#privatemsg_message'] to $form_state['storage']
- Renamed privatemsg_attachments_privatemsg_message_delete to ..._flush, so that attachments only get deleted when they are flushed. Relies on the flush patch obviously, but is ignored if that one is not present.
- Used the trick described at http://drupal.org/patch/create to add new files into a new directory with a patch.

in privatemsg.module:
- remove old comment about #privatemsg_message
- add $form_state['storage'] to $message

* With the changes in #375999: #288183 followup: Developer friendlify privatemsg_new_thread API. , it would be possible to programatically send messages with attachments, this is not yet documented. First, save a file with file_save_upload and second, add the relevant infos to $options['files']. This module could maybe provide a helper method.

PS: @velo: It is *very* unlikely that someone of the developers (litwol, nbz, me, ..) will work on attachments for privatemsg 5.x-3.0, I never used 5.x.

Sophia’s picture

Would this work with upload path, I can test it if you wish.

Berdir’s picture

upload path? Can't follow you, do you mean private/public downloads?

As this module is more or less a port of the upload.module of core, changes are high that it will (maybe with some work) work together with stuff that is supported by the upload.module.

But I haven't tested it yet.

Sophia’s picture

Sorry, I was not very clear, was I. We use the upload path module (http://drupal.org/project/uploadpath) where users upload files to their own personal folder. I was wondering whether that module would clash with this one... but I shall test it soon and let you know.

Sophia’s picture

I have tested the module, and I can confirm it works perfectly. However, it does not take the uploadpath module into consideration, PM uploads are attachment in the "normal" upload folder instead of the personal folders uploadpath provides.

Berdir’s picture

About uploadpath, I just had a short look at the code. They use hook_nodeapi to rename the files so it obviously doesn't work with privatemsg_attachments.

However, they could also add a hook_privatemsg_message_insert and use the same code, they would just need to loop over $message['files'] instead of $node->files. I would suggest to add a feature request to that module when this has been commited. It doesn't really makes sense before.

Sophia’s picture

I shall certainly do that, Berdir, not that is it is very important but it would create a consistent environment. I am not sure what you mean by "when this has been commited", does it require action from my side?

Berdir’s picture

No, it doesn't. What I meant was that is doesn't really make sense for the upload_path module to write and commit a privatemsg hook when the privatemsg_attachments module is not part of an official privatemsg release.

But you could already open a feature request there and point to that thread and the api documentation.

Sophia’s picture

Done... http://drupal.org/node/398886 and I changed to status to "postponed".
And thanks :)

uprojects’s picture

Berdir

Why call the access "Upload files" ? The best is to create a permission in the privatemsg modules.Because for example in my site i have user who can upload file in a node but can not send attachment in private message !

redhatmatt’s picture

are the attachments supposed to appear in the recipients message? In my case they upload to the images folder but do not get listed in the message....

bentonboomslang’s picture

Hi,
Sorry to be a pain but I've read the above up and down several times and I've got myself really confused. It's not the first time i've tried patching etc. but I am fairly new to it and there are a few things I'd like clarifying...

1. Are add on modules like this designed to be used with the rc version or the dev version of this module?
2. Is it still necessary to apply the API patch near the top of the page or is this included in more recent releases of the module?
3. Should patches be applied on top of one another in chronological order or do you only need to apply the most up to date one?
4. Where should I be looking for the answers to these kinds of questions?

I would love to use this module extension - could someone who has it working kindly describe the exact steps I need to get it going.

Many thanks,

Ben

Berdir’s picture

1. Are add on modules like this designed to be used with the rc version or the dev version of this module?

Patches are always against -dev version. -dev is where the development happens, it does not make sense to create a patch against releases.

2. Is it still necessary to apply the API patch near the top of the page or is this included in more recent releases of the module?
3. Should patches be applied on top of one another in chronological order or do you only need to apply the most up to date one?

Just the latest patch should be enough.

4. Where should I be looking for the answers to these kinds of questions?

You can look at http://drupal.org/patch, this is a generic explanation of how to apply and create patches.

bentonboomslang’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc3

How do these patches relate to the new release of Private Message? Should they still work? Which one to use? I can't get them to work. I'm getting the upload field on the "write message" page but nothing appears at the recipients end.

Any advice?

Many thanks,

B

yajnin’s picture

subscribe

deltab’s picture

many thanks - most of my users seem to want this feature

Berdir’s picture

Thanks to #599358: Simplify pm_send_validate and pass custom fields/values through., this does not need any changes to privatemsg.module anymore.

Just unzip the attached archive (which contains a few bug fixes) into your modules directory and enable the module. It is possible that the necessary change is not yet in the -dev version, to be safe, wait a few hours before you download it, as that one is only rebuild every 12h.

ashjeyes’s picture

I have installed the module, and it looks great in the write message screen, however when the recipient receives the message there is no sign of the attachment. Are you able to shed some light on this, or is there a step that I have missed out during the install?

Cheers

Berdir’s picture

Version: 6.x-1.0-rc3 » 6.x-1.x-dev

Are you using the latest (rc4) version of privatemsg? It will only work with that one...

homebrewruss’s picture

I'm getting the same issue as @ashjeyes - any ideas why this could be?

Thanks

Berdir’s picture

As I've already said, something like that should only happen if you use a old version of privatemsg.module.

Make sure you are using the latest version of privatemsg.module (rc4 or a newer -dev release) (without any of the patches that were posted in this issue earlier) and *only* the privatemsg_attachments-1.tar_.gz file from comment #37.

stephenhendry’s picture

Subscribe

hugafish’s picture

I used no patches and uploaded rc4 version to my modules directory turned on the module, I then extracted the tar file from #37 and uploaded the privatemsg_attachments folder to my modules directory. Then I turned this module on. I too can see the attach file form, and all seems to function properly from the write new message part. However when I open up the message as a receiver of the message, I cannot see any attachment anywhere. Is there a particular place I should be looking for this attachment ? I tried this whole process again with the latest dev version too but no difference. I am using Drupal 6.13

Eric

ashjeyes’s picture

@berdir I had RC3, I'll upgrade to RC4 and let you know. Cheers

ashjeyes’s picture

@berdir, thanks for the advice, now working with RC4. Apologies if I had missed that instruction in previous documentation

BenK’s picture

Subscribing...

Bilmar’s picture

subscribing

Berdir’s picture

Instead of a subscribe, if you are interested in the attachments module ( or any others), try it out on your site and report back if it works or if there are any issues.

From what I can tell, this should be finished and working, all it needs are some confirmations that it does work on different sites. Code reviews would be great too :)

Bilmar’s picture

Tested with Privatemsg 6.x-2.x-dev and it worked great!

A few thoughts I had from testing:
1) I was not able to send a message with only an attachment as 'Message' is required. I believe this is by design?
Example: gmail has confirmation popup box "Send this message without text in the body?" or "Send message without a subject?"
2) Will it be possible to have an option to show preview if attachment is an image file?

Thanks for the great work Berdir!

*Edit: I first wrote it didn't work with 6.x-2.x-dev and worked with 6.x-1.x-dev but after reinstalling and flushing cache it worked great.

hugafish’s picture

I'm getting ready to update some modules on my site. I will let you know if this works for my site for testing purposes. I love this module even without attachments but this would be a great addition. Thanks for building this module for everyone!!!

Eric

BenK’s picture

Hey Berdir and everyone,

I've just finished some pretty extensive testing of the attachments module listed in #37. The basic functionality did work, but I noticed at least one issue that should be addressed before an official release (as well as a few suggestions for improved usability/features):

1. Attachments don't attach if you "Preview Message"

If you decide to "preview message" instead of "send message," it appears that the attachment will work because you can see the attachment file name in the preview of the message. However, the message is not being attached. This appears to be because the actual uploaded attachment is not being retained in the "File Attachments" field group on the preview page.

2. Rules Module Debug Info Displays in "File Attachments" Field Group

This is a minor issue only affecting those also using the Rules module in "debug" mode. It appears that all of the Rules debug information is not only being displayed at the top of the page, but also within the "File Attachments" field group (if you've specified a rule that fires when a page is viewed). It's probably an issue that only affects developers and power users, but would be nice to have fixed.

3. Ability to Specify Upload Folder

At the moment, it appears that the attached file is placed in the default file system folder for the site (specified at admin/settings/file-system). But once you have more than just a few users attaching files, this would get really hard to manage all of the files in your main file folder. It would be better if you could specify a file system path for attachments on the main private message settings page (admin/settings/messages). Better yet, it would be great if you could specify tokens in the file path (so that you could organize attachments into folders by user), but this isn't necessarily essential.

4. Indication on /messages Page That Message Has Attachment

In terms of usability, it would be nice if there was an icon on the main /messages page that indicated if a message had an attachment. This obviously isn't critical, but would be a nice feature. This could be as simple as a little paperclip icon (like the one used for attachments in gmail). A simple way to do this would be to make a separate column for the attachment icon configurable at /admin/settings/messages in the "Configure fields" section.

5. Permissions for "upload private message attachment" and "view uploaded private message attachment"

In our use case, we don't want to let everyone who can write a private message also attach a file to that message. I don't think the upload module's "upload files" permission is adequate because we probably want some users to be able to upload files in other sections of the site, but not on a private message. We'd rather have a separate "upload private message attachment" permission so that only more trusted users can attach files to private messages. If this permission was created, it would also be great to create a "view uploaded private message attachment" permission, so that you could control who could see the attachment when implementing automated private messages (using Rules module or other future mass mailing capability).

6. Integration with new privatemsg_rules sub-module

The new integration with Rules module appears to be nearly complete (see http://drupal.org/node/327938). Berdir has done really great work on this. I'd love to be able to include an attachment with a private message generated by a Rules action. (In fact, this is the primary use case where we would want to use attachments.) So we'd just need to get privatemsg_attachments and privatemsg_rules working with each other. Does this seen feasible, Berdir?

Cheers,
Ben

Berdir’s picture

Thanks again, this is going to take some more time to fix I think :)

Some feedback already...
1. Confirmed, need to figure out how to fix that, I fear it's not easy...

2. Can you test if the same happens with upload.module? I suppose so and would say that's actually a feature, since the upload is supposed to show messages in case an error happened.

3. Token support might come later, but specifying an directory should be possible

4. Like the idea.

5. Done

6. If rules is able to handle files ( need to figure that out and how), sure...

Berdir’s picture

Some updates:

- The module now comes with a simple test (upload, preview, send, test display)
- Fixed preview handling, I think I broke that with some of the last updates
- Option to specifiy upload folder
- Own permissions

This means that 1, 3 and 5 are atleast partly fixed/implemented.

PepeMty’s picture

Re: #53

I installed privatemsg_attachments_2.tar_.gz, configured permissions and found this in messages/new:

warning: array_unshift() [function.array-unshift]: The first argument should be an array in /home/xxxxx/xxxxxxxx.com/sites/all/modules/privatemsg_attachments/privatemsg_attachments.module on line 63.

Any idea somebody?

Thanks in advance!

Warm regards from (right now not so) sunny México!
:-)
Pepe

Berdir’s picture

Version: 6.x-1.x-dev »

I suppose you are using privatemsg 1.x?

I've tested the latest release only with 6.x-2.x-dev, it probably doesn't work with 1.x anymore.

PepeMty’s picture

You are right... I am using privatemsg 1.1.

Hmmm... Let me give a try to 6.x-2.x-dev. I'll report back whatever I find... :-)

Warm regards...
Pepe

EDIT: That did the trick. I just have to add that apparently, despite the error message, everythinig was working OK since I received the trial messages + the attachments. The message was disturbing nonetheless. ;-)
I send you my best...

Berdir’s picture

Small update

- The module now adds an optional column that displays an attachment symbol(public domain from http://i.hbtronix.de/index.php?start=all&t=mini) if there are any.

hugafish’s picture

Help me out here to get this going for testing. I am a live site, so how safe is this to try? If not safe how soon till RC version. I will unpack the Privatemsg 6.x-2.x-dev file from module rep then unpack the tarball supplied in the above #57 posting, then copy it's contents into the Privatemsg 6.x-2.x-dev directory that I unpacked earlier, then upload to my sites module directory. Will this work and give me a working Privatemsg with file attachment?

Eric

Berdir’s picture

The attachments module should be quite stable. I'm waiting for a few positive test/review reports (That's where you come in! ;)) and then I'll include this into the 2.x branch.

However, it will take some time until the 2.x branch will become officially stable. There are still lots of things to figure out and when adding new features, there is always the chance of breaking stuff. However, I'm trying to keep the branch as stable as possibe and bugs are usually fixed within days.

Edit: Yeah, that's all you need to do. You need to enable the module before you can use it, but that should be all.

duozersk’s picture

My sincere congratulations for this great functionality adding to the Private Messages module.

I hunted down a small bug for you. privatemsg_attachements.module, Line 44 and below:

    if (!file_check_directory($path, FILE_CREATE_DIRECTORY) || !file_check_directory($temp, FILE_CREATE_DIRECTORY)) {
      $form['attachments']['#description'] =  t('File attachments are disabled. The file directories have not been properly configured.');
      if (user_access('administer site configuration')) {
        $form['attachments']['#description'] .= ' '. t('Please visit the <a href="@admin-file-system">file system configuration page</a>.', array('@admin-file-system' => url('admin/settings/file-system')));
      }
      else {
        $form['attachments']['#description'] .= ' '. t('Please contact the site administrator.');
      }
    }

It modifies the form item not within the ['privatemsg'] fieldset - and so the error messages are not shown.

I fixed it this way:

    if (!file_check_directory($path, FILE_CREATE_DIRECTORY) || !file_check_directory($temp, FILE_CREATE_DIRECTORY)) {
      $form['privatemsg']['attachments']['#description'] =  t('File attachments are disabled. The file directories have not been properly configured.');
      if (user_access('administer site configuration')) {
        $form['privatemsg']['attachments']['#description'] .= ' '. t('Please visit the <a href="@admin-file-system">file system configuration page</a>.', array('@admin-file-system' => url('admin/settings/file-system')));
      }
      else {
        $form['privatemsg']['attachments']['#description'] .= ' '. t('Please contact the site administrator.');
      }
    }

Hope this helps.

Thanks
AndyB

Berdir’s picture

Thanks for catching. You are welcome to upload an updated version of the module yourself. Will include your fix in the next re-roll if you don't.

hugafish’s picture

Thanks Berdir, I will try to get this module updated on my site this week sometime if I can, and will ask a few of my regulars to test it with me. This is going to be a great enhancement to my site and appreciate all of your work with it.

Eric

duozersk’s picture

Thanks for the great module.

Tested it out on development site and finally deployed to production.

Few notes:
1. It looks like the directory you set privatemsg_attachments to save the files to should already exist on your server. If not - the files will be saved into the root of your default Drupal files folder.
2. In the light of Drupal development I would try to investigate if it is possible to migrate this functionality to use the Filefield instead of Upload module.

Thanks
AndyB

Berdir’s picture

1. It looks like the directory you set privatemsg_attachments to save the files to should already exist on your server. If not - the files will be saved into the root of your default Drupal files folder.

Yeah, I should check that and create if necessary. Another thing I have to fix.

2. In the light of Drupal development I would try to investigate if it is possible to migrate this functionality to use the Filefield instead of Upload module.

Very unlikely. Filefield depends on CCK which only works on Nodes. However, for Drupal 7, Privatemsg will, instead of this module, be fieldable which will allow to add any field you want (files, images, text, ....) to private messages.

duozersk’s picture

Thanks, Berdir, got you. Very freaking awesome to have Privatemsg fieldable with Drupal 7 release. :)

igorik’s picture

Hi Berdir, really there is no solution how to use cck filefiled although privatemsg isn't node?
If it would be possible, It will solve all problems with uploading, displaying, deleting, accessing (permissons) of attached files/images.

IMHO, filefield would be really nice and effective solution of this.

crea’s picture

Subscribing

NaheemSays’s picture

@ igorik - that may be a solution with teh Drupal 7 version, but afaik CCK only works for nodes in Drupal 6

Berdir’s picture

Yeah, as I said before, this module is a re-write of upload.module, which is a single module and after all, quite simple. Rewriting CCK and Filefield would be a huge effort and I am simply not going to do that.

It will solve all problems with uploading, displaying, deleting, accessing (permissons) of attached files/image

What problems?

Again, private messages will be fieldable in Drupal 7, which will allow to attach pretty much everything to them. But there is no way that it will be backported to Drupal 6.

hugafish’s picture

Well I just installed the Private Message with file attachment module. Using 6.x-2.x-dev and privatemsg_attachments_3.tar_.gz. I do not have the rules part of this module turned on, just fyi. I just sent my first message with a file attached with no errors and so far everything looks as if it went through without a hitch. I will let you know if I see any issues with this, if I don't post anything this means everything is working as expected for my usage. Thank you so very much for this enhancement for the Drupal 6 users, hats off to you!!!

Eric

Berdir’s picture

Ok, fixed the bugs reported in #60(errors not reported) and #63 (directory wasn't created), thanks for testing duzersk!

Attaching the module as a tar.gz and as a patch, so that the tests are run on the test bot. Note that the patch doesn't contain the gif file.

hugafish’s picture

Hello, haven't applied any patches to this module. Everything seems to work functionally so far. I will wait until fixes are put into next release before upgrading. I am not good with patching, maybe I will take some time to learn how and give it a try. I did notice one peculiarity with this module, and that is when I went into the permissions area today to look at some other setting for some other site functionality I noticed that one of my main roles had the private message attachment permissions not ticked. I do not recall changing them to this, but I can't be 100% sure of that so I will keep an eye on that.

*Edit--- The more I think about it I think this was my oversight with leaving a particular role out from this option.

Eric

Berdir’s picture

Status: Needs review » Fixed

Ok, I finally comitted this, thanks everyone for testing!

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

NaheemSays’s picture

Version: » 7.x-1.x-dev
Status: Fixed » Needs work

I would guess it is better to set it to this to then work on the upgrade path for drupal 7?

Moving to fields if possible.

(apologies for not being around much - that should change soon.)

Berdir’s picture

Title: Attachments for privatemsg » Create upgrade path from privatemsg_attachments to filefield
Status: Needs work » Postponed

Makes sense. Since we need to make privatemsg fieldable first, let's mark it postponed. Also changing the title.

(apologies for not being around much - that should change soon.)

No problem, take your time. If you have time, testing the inbox tag patch would be most appreciated, since that is imho one of the most important things.

Honza Pobořil’s picture

subscribe

pupazzo’s picture

Hi everybody.

Thanks for your time and passion in developing this module I find very useful.

I'm a newbie in Drupal stuff, so please be patient with me :-)

By the way I installed the module you developed, the privatemsg_attachments_4, the privatemsg 2.x and everything seems to be "quite" ok.

There are a couple of things that I don't understand:

1. drupal always saves the the attached files in the same directory: /sites/default/files, for any user, and this is not a wise thing, even because it doesn't change the name of the file, and so many overwritings can happen.

2. it works perfectly unless I set the "private" option in the file sistem. If I do so, drupal can't find the file...

I'm quite sure that I did something wrong, maybe some other module to install, or some options to consider... any suggestion?

Thanks for your help

Berdir’s picture

By the way I installed the module you developed, the privatemsg_attachments_4, the privatemsg 2.x and everything seems to be "quite" ok.

Not necessary anymore, it has been commited. Just download the latest 2.x-dev version and you have privatemsg_attachments too.

1. drupal always saves the the attached files in the same directory: /sites/default/files, for any user, and this is not a wise thing, even because it doesn't change the name of the file, and so many overwritings can happen.

No. Drupal automatically renames an upload file when there is already one with the same name.

2. it works perfectly unless I set the "private" option in the file sistem. If I do so, drupal can't find the file...

Yep, that's a bug. But let's handle that in a separate issue, this is now about providing an upgrade path for Drupal 7, since the module has been commited. See #719812: Privatemsg attachment does not work with private downloads.

yajnin’s picture

subscribe

stickDeath’s picture

Worked for me with privatemsg 6.x-2.x-dev.

i just wonder, how can I set privatemsg with UTF8, special chars are not showings well.

ty all

Berdir’s picture

Privatemsg does not care about your encoding, if it's not working, start by checking the encoding of your database. If not even preview works, then something is wrong with your drupal installation.

Anyway, back to topic..

The fields patch has now been commited so I need a new reason for postponing this :) That reason is #685892: Upload -> File module upgrade path is broken, where the currently broken upgrade path from upload.module is fixed. Once that is in, it should be relatively easy to adapt that to privatemsg_attachments.

erik.ahlswede’s picture

Status: Postponed » Needs review

#71: privatemsg_attachments_4.patch queued for re-testing.

Berdir’s picture

Status: Needs review » Postponed
Berdir’s picture

Category: feature » bug
Priority: Normal » Major
Status: Postponed » Active
JohnnyW’s picture

Status: Active » Needs review

#71: privatemsg_attachments_4.patch queued for re-testing.

NaheemSays’s picture

That patch is not the upgrade path, but the earlier patch to add attachments to privatemsg for drupal 6.

AFAIK Retesting it wont accomplish anything.

Berdir’s picture

Status: Needs review » Active

Correct.

timbitx’s picture

Hello,

I am testing the privatemsg_attachment module on a local server.

I have tried version 3 and 4 and have received this error message. Any ideas??

warning: array_unshift() expects parameter 1 to be array, null given in /LOCALHOST/drupal6/modules/privatemsg_attachments 3/privatemsg_attachments.module on line 63.

For version 4 it is on line 69.

Thanks!
Tim

Andrey Simakov’s picture

Status: Active » Needs review

#71: privatemsg_attachments_4.patch queued for re-testing.

Berdir’s picture

Status: Needs review » Active

The patch in #71 was for 6.x.

ivnish’s picture

Issue summary: View changes
Status: Active » Closed (outdated)