Here's a patch that makes privatemsg compatible with Drupal 5.0 , even though the module itself is pretty incorrect (doesn't use _submit handlers, etc).

Comments

adrian’s picture

StatusFileSize
new71 bytes

and here's the .info file that's necessary for it to work.

adrian’s picture

StatusFileSize
new8.31 KB

fixed the hook_link and the My inbox menu item.

uptimebox’s picture

Fatal error: Cannot use string offset as an array in /home/spider/Projects/rolevikov.net/drupal/modules/system/system.module on line 1046

At admin/settings/privatemsg

Anonymous’s picture

Hi adrian ,

I am currently building the new SFX2 website for the mozilla foundation and would like to include this module as early as possible into my code.

Would you please let me know Adrian if your working on this and if i can helpout in any way ?

Regards Paul

btmash’s picture

StatusFileSize
new9.28 KB

I've taken what adrian was working on, saw the error uptimebox got, and was able to figure out that error was being caused by the form being generated in the configuration.

Here is my patch file to take a look at (it has what adrian did so there is redundancy)

btmash’s picture

Hmm...the js changes don't seem to be working on my computer. I'll try and see what I can do with it (otherwise the user has to type it in the "To" field)

btmash’s picture

StatusFileSize
new891 bytes

Here is a patch for the javascript file - I'm not entirely sure if I did grabbed the text field correctly (hopefully someone can let me know more on that) but it does seem to be working.

Oranor’s picture

There is still a problem with the module when you use a translation. For example the new folder creation doesn't work when the Button string "Add Folder" is translated. The reason seems to be the privatemsg_page() function:

function privatemsg_page() {
...
  switch ($op) {
...
    case t('New folder'):
    case t('Add folder'):
    ...
  }
}

This seems to work in Drupal 4.7 (I checked it), but not in 5.0. Any ideas why?

Oranor’s picture

StatusFileSize
new14.93 KB

Added a patch to fix this problem. It seems only to affect new folder creation. Additionally I fixed the "delete folder" functionality, which didn't work. The module should now work correctly with Drupal 5.0. I used the contributions from adrian and BTMash. The patch is against the cvs HEAD version.

btmash’s picture

I tried using your patches, but I got errors regarding the form when I tried to load up the page) - when I tried to add a page, I would get a blank screen (no errors show up in watchdog either :/)

btmash’s picture

Would it be possible if you could post your privatemsg file? I am not sure of what I may have overlooked against my file.

enky’s picture

can you please upload the privatemsg.module file?
i dont have patch utility,

thanks,
enky.

Marandb’s picture

I too would appreciate it if there was a full .module file available. Could you please upload a working copy?

I can run it on my testsite and let you know if I run into any errors. We use private messages alot.

Thank you very much for your effort on this.
-- Marandb

gaijinu’s picture

Well, the patch works in 5.0. Thanks a bunch guys!
I didn't test it thoroughly yet.

BTMash:
Try to comment out lines 3-5 from privatemsg.module, it's only a debug thingy.

enky4u, etc:
Get patch for windows

Cheers

mjarkiver’s picture

Is it really that much to ask for someone to just post the files already patched? Not all of us are that familiar with doing this type of patching, and it would save a lot of time if one of you who already incorporated the patch would just simply upload it. I mean is it really such a huge hassle to do that? I for one, and I'm sure others, would really appreciate it.

--mj

kus’s picture

subscribe to thread

mjohnq3’s picture

I agree... after 7 patches it's time to post the updated module somewhere.

hectorplus’s picture

I am not familiar with patching too, so if someone can take a moment to upload the module patched already. Thank you.

sepeck’s picture

Well, here is a page on patch so you can test the contributed patches and provide feedback on the effectiveness of the patches linked in the thread.
http://drupal.org/node/22568

leducdubleuet’s picture

One way to apply a patch is to place the ".diff" file into the "modules" folder and run this from a console:

/Dev/drupal/modules$ patch -p0 < privatemsg_7.diff

I hope this helps someone...

Oranor’s picture

StatusFileSize
new11.06 KB

I made a new patch that fixed a bug which prevented messages to get deleted by marking the check box in the message list and pressing "Delete messages". Did some integration with the current HEAD version. Especially I re-enabled the API and support for auto-completion of recipient names, which wasn't in the last patch. Additionally I removed my debugging code.

I think the module is now stable enough to create a development snapshot. Could please one of the 21 developers of this module create one and place it in the download section? The patch is against the HEAD revision.

mindless’s picture

Status: Needs review » Active

I applied changes based on this patch and created a DRUPAL-5 branch.

Some questions:
In the js: why not this.value instead of this.options[this.selectedIndex].value?
i kept this.selectedIndex = 0 in there, hope that's ok.

do move to folder and empty folder operations work?
(didn't see any $_POST vs $edit changes there)

does 'new folder' without folder name properly show form asking for name?
(ie is !$edit['name'] check ok, or should be this be _POST?)

gaijinu’s picture

Hi Oranor, thanks for your work. Tried to patch, but got some errors:

patching file privatemsg/privatemsg.js
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file privatemsg/privatemsg.js.rej
patching file privatemsg/privatemsg.module
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 37.
Hunk #3 FAILED at 53.
Hunk #4 succeeded at 248 with fuzz 1 (offset -39 lines).
Hunk #5 succeeded at 256 (offset -39 lines).
Hunk #6 succeeded at 300 (offset -39 lines).
Hunk #7 succeeded at 321 (offset -39 lines).
Hunk #8 succeeded at 413 (offset -39 lines).
Hunk #9 FAILED at 454.
Hunk #10 succeeded at 464 with fuzz 2 (offset -50 lines).
Hunk #11 succeeded at 493 (offset -50 lines).
Hunk #12 succeeded at 579 (offset -64 lines).
Hunk #13 succeeded at 593 (offset -64 lines).
Hunk #14 succeeded at 642 (offset -64 lines).
Hunk #15 succeeded at 671 (offset -64 lines).
Hunk #16 succeeded at 678 (offset -64 lines).
Hunk #17 succeeded at 708 (offset -64 lines).
Hunk #18 succeeded at 762 (offset -64 lines).
Hunk #19 succeeded at 787 (offset -64 lines).
Hunk #20 succeeded at 796 (offset -64 lines).
Hunk #21 succeeded at 817 (offset -64 lines).
4 out of 21 hunks FAILED -- saving rejects to file privatemsg/privatemsg.module.rej

Also there is no .info file. Please check.
Thanks!

mindless’s picture

gaijinu (and everyone), please don't use the patch here but try the DRUPAL-5 branch in CVS. Development snapshots for this branch should show up in the privatemsg project page soon.
I did some major restructuring of the code to use more menu callbacks and form validate/submit functions.. these changes are now in both DRUPAL-4-7 and DRUPAL-5 branches, so please test, thanks!

Marandb’s picture

Excellent, thank you to everyone for their work.

I will download the dev version and start posting any bugs.

Thanks again, this has been a HUGE help.

-- Marandb

hectorplus’s picture

I just installed the module(dev), however, private messages are being sent automatically to Anonymous user. I posted the bug.

mindless’s picture

Assigned: Unassigned » mindless

I fixed sending private msgs (did nothing) and Move to folder (controls were missing). Didn't see any problems with viewing of Sent messages folder.

mindless’s picture

Status: Active » Fixed

I fixed a conflict with send.module (#113999).. marking this task as fixed now. Still let me know if you've tested this out and if you think it's ready for a 5.x-1.0 release, thanks.

gaijinu’s picture

Tested on 5.1, looks fine here.

hectorplus’s picture

Its working, release it for D5.

mindless’s picture

Done, thanks!

mjohnq3’s picture

Just downloaded and installed it... works great. Thanks for the update to v5.

Anonymous’s picture

Status: Fixed » Closed (fixed)