Closed (fixed)
Project:
Privatemsg
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Feb 2009 at 01:42 UTC
Updated:
27 May 2013 at 00:24 UTC
Jump to comment: Most recent file
Comments
Comment #1
andypostWhat for? Suppose form should be easy-readable but if you need a special it's possible to form_alter + theme
Comment #2
nicholas.alipaz commentedactually, I was able to alter the private message input filter by changing the default input filter for the site. Then just specify alternate input filters as needed. Thanks for the response, I am marking as fixed since the feature is kind of already provided by drupal.
Comment #4
redhatmatt commentedI turned on default and it does not load the wysiwyg filter in...
Comment #5
naheemsays commentedThat only sets up the input format. as for setting up the wysiwyg, you need to somehow tell wysiwyg to show an editor for the relevant text areas. Not a problem with privatemsg.
Comment #6
berdirI assume this is because the privatemsg textfield is not connected with a "filter widget/chooser", so it is not recognised by wysiwyg.
We may add full input format support at some time, but I don't consider it a high priority. Especially since it might just work (Fields..) with D7.
Comment #7
berdirOk, here is a first working patch, please test and review...
- Adds a format column to the pm_message table, including upgrade path
- Adds an input filter selector to the new/reply form
- I noticed a strange behavior when I added the filter after the body in the code, the resizable stuff broke, and the body was only 10 cols wide, so I removed that definition. This also fixes that bug report #513656: ie8 shows to small message box if JS Optimizing is on
- It works perfectly fine with wysiwyg now..
- No configuration yet, maybe we need to add some settings (allow/disallow)
- Should also work with the API
Comment #8
litwol commentedVery nice. I did a quick review and things look good for the most part.
Little change in my patch is loading pm.format in privatemsg_sql_load(), without it we get notices that $message['format'] is not a valid index on line 427.
Each filter is per message which made me rather enjoy playing with thread view by refreshing it with a message having this body:
Review action point: We need to find other places where we may be missing to load pm.format.
I'll do another review later with different wysiwyg editors as i dont have any installed yet.
Comment #9
naheemsays commentedthe format column is not included in privatemsg_schema(), so this will fail for new installs. Also, would we need some sort of updated index for this?
Also, an unrelated doc issue that can be fixed here:
^^ That comment should be moved to before the sql_list function (and a second comment to define that query should also be added). May not be for this patch though.
apart from that it looks good.
When this goes in, pmgrowl will need to be updated to allow for the greater choices of input format.
Comment #10
naheemsays commentedpatch rolled to fix the above.
Comment #11
berdirThanks for the re-roll.
That happens if you drink beer between writing, testing and uploading a patch. :)
Comment #12
naheemsays commentedI wa meant to set this to rtbc, not the other issue.
Comment #13
naheemsays commentedrerolled.
Comment #14
litwol commentedHow many people actually using this patch on their live site ?
Comment #15
nicholas.alipaz commentedI am using it on two sites.
Comment #16
igorik commentedI plan to try it in near feature, because I want to switch from fckeditor module into Wysiwyg module, and without this input filter I can't have wysiwyg editor on private message textarea.
Comment #17
litwol commented@igorik : Do it soon please. We need live site testers to make sure things work as expected, otherwise it stalls this patch from being committed.
Comment #18
igorik commentedHi Litwol,
I just patched it and testing it. It seems that it works fine. Thanks.
I have some "design bug", I am using better_formats module which can hide format selection fieldset, info about formatting and more else things.
It is handy module. But now I can see under privatemessage textarea collapsed fieldset for choosing text format.
(screenshot attached)
So I have correctly hide this info on all edit pages with textareas on site except privatemsg textareas.
The permission for better formats are:
There will be probably needed to create a new permission "show format selection for private messages", I think. Do you think that it is work for Better formats module developer, or it will be permission hook in private message module?
thanks and have a nice day
Igor
Comment #19
berdirWell, that's not a design bug, that is simply a missing feature :)
I thought about adding a permission too, but adding it to better_formats does probably make more sense if they are willing to add it. You could create an issue there and cross-link it.
Comment #20
igorik commentedI added a feature request for better_formats for hiding fieldset select format on privatemessage textarea.
http://drupal.org/node/581308
Back to original issue - new privatemessage support for input format works very well.
Thanks
Comment #21
finex commentedI've just applied the patch and it works quite well. The only problem I've encountered is that all 2000 old messages input format was set to "0" (while previously it was used the default input format: Filtered HTML.
Integrating this patch taking care of better formats (or modify better formats for this patch) would be very useful.
Comment #22
berdirThis should not happen, it is supposed to use the current default format for those existing messages. I'll look into it.
Comment #23
berdirUhm.
It is working fine for me and it's pretty much the same code as system_update_6051() which added the signature_format column.
I'm guessing you have never actually saved the default format form, so variable_get() is using the default value. I updated it to use 1 instead of 0.
Can you remove the pm_message.format column and re-run the 6004 update? It should update the format column to 1 then.
Comment #24
dragonwize commentedAny time you use the FILTER_FORMAT_DEFAULT global you need to wrap it in filter_resolve_format(). That will get the site default when it is set to 0.
Comment #25
artscoop commentedI am using this patch.
Comment #26
naheemsays commentedas per #24
Comment #27
berdircheck_format() already uses filter_resolve_format(), that means we should probably revert to 0 as default value
The question is, what should happen if you change the default format? If 0 is used, all messages will use the new default and if 1 is used, they will still use the "old" format. Not sure what is correct, new messages *will* store the actual value and not 0.
Comment #28
naheemsays commented@Berdir - that should not be aproblem as at the time of update the messages would be broken anyway if the format had been changed to something incompatible. Not our problem IMO.
Comment #29
naheemsays commentedSetting this back to rtbc after some discussion on irc.
I think it best to get this committed and if there are problems, they can be fixed once discovered.
Comment #30
berdirFixed in 6.x-1.x-dev.
Porting this is a bit more complicated than other things as there were quite a few changes to filter.module. If someone does test this, note that there are currently a few bugs in the 7.x-1.x-dev version because there were changes in Core (for example, autocomplete does not work because drupal_json() was removed)
Edit: The attached patch should work, but note that there is currently no update functions, since I would say that we should currently not support 7.x -> 7.x updates as core doesn't do it either right now. And all users upgrading from 6.x will already have the format column.
Comment #31
andypostReopened issue in better_formats queue #581308: support for hiding info about select format for private message textarea
Comment #32
naheemsays commentedagreed at the lack of need for an update function for this.
Comment #33
berdirAdded to 7.x-1.x-dev.
Comment #35
meustrus commentedIs this patched in 6.x-2.x-dev?
Comment #36
Jarode commentedIt would be nice if the default field "body" could support better format module ...
It is not possible de mange body field settings...
:'(
Comment #37
Jarode commentedComment #38
ptmkenny commented@Jarode #36 Do not re-open old issues if the fix was correct (which in this case it was). If you have a new but related issue, open a new issue.