Download & Extend

Per-user text format preference

Project:Drupal core
Version:8.x-dev
Component:filter.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:SettingsAPI

Issue Summary

Here's a patch to filter.module that allows users to set their preferred input format, when multiple formats are available. A selection of available formats is added to the user-account editing page. The user's selection is persistent and is used to initialize the input-format selector on the node-editing pages. This patch requires an addition of an 'input_format' field to the {users} table:

   alter table users add input_format int(4) NOT NULL default '0';

I'm not 100% sure I did this correctly. I'm no PHP coder. Anyway, it seems to work.

Patch file is attached.

Enjoy.

AttachmentSizeStatusTest resultOperations
filter.module_9.patch1.61 KBIgnored: Check issue status.NoneNone

Comments

#1

i like the convenience of this ... for this sort of pref, i prefer that we simply remember what the user chose as an input format the last time. that the most natural way to use this. who wants to go totheir profile page? i propose to do away with the UI on the profile form but i don't feel strongly about that.

#2

i like the convenience of this ... for this sort of pref, i prefer that we simply remember what the user chose as an input format the last time. that the most natural way to use this. who wants to go totheir profile page? i propose to do away with the UI on the profile form but i don't feel strongly about that.

I agree, just remembering the previous selection would be nice though perhaps harder to implement (for me anyway). However, keeping the profile-page UI as well might allow for the extension of having per-node-type input-format preferences as well (e.g. wiki for blog, html for book) though there may be no real demand for that. Of course, I never let a lack of demand deter me. :-)

#3

Version:4.6.1» x.y.z
Status:needs review» needs work

I am with Moshe, please add this to a session variable. There are already lots of settings on the user profiles that users do not care about.

#4

to clarify, i recommend a persistant hidden user preference, not a session variable.

#5

subscription.module has such code for its 'subscribe' chechbox on the node form.

#6

I've just created a module that remembers the last input filter used by each user without requiring an update to core. I've created a project for it (http://drupal.org/node/47983), but I don't have a CVS account yet. Once that gets created, I'll upload the code for perusal.

It operates without needing any settings, so there's no additional clutter to worry about.

#7

If the last choice of the user is remembered, could we finally get rid of the enforced default that is hindering us? Can the default not just be the first filter?

#8

If the last choice of the user is remembered, could we finally get rid of the enforced default that is hindering us?

Not based on my module. It only works for node creation/editing, not things like comments or other cases that don't use the nodeapi hooks.

#9

Version:x.y.z» 7.x-dev

Feature request, moving to cvs.

#10

Title:Per-User Input-Format Preferences» Per-user text format preference
Version:7.x-dev» 8.x-dev

#11

That would be useful, indeed.

#12

+1 (and also tagging as a very interesting possible edge/use case for a theoretical SettingsAPI...)