mode column in {users}?
Does anyone know if any core module uses the 'mode' column in the {users} table? A quick search with grep didn't turn up anything so I was thinking about using it as a flag for per-user behavior for a custom module for a little site. -Peter
If it is not used by anyone else, then we should rename it to reflect what it does, so it is not ambiguous. I wonder if this sets a precedence or something about columns used only by contrib module(s) and possible clashes where one module thinks it is for X and another thinks it is for Y and they overwrite each other. Can't you just create your own table for that module and make uid the primary key for it? Yes, an extra join, but then that table is solely yours, and everyone else should keep their grimy hands off. On 5/12/07, Peter Wolanin <pwolanin@gmail.com> wrote:
Does anyone know if any core module uses the 'mode' column in the {users} table? A quick search with grep didn't turn up anything so I was thinking about using it as a flag for per-user behavior for a custom module for a little site.
-Peter
-- 2bits.com http://2bits.com Drupal development, customization and consulting.
You don't have to reuse columns. Just create a new column and use that same name in your hook_user(form) and user.mnodule automatically does the save/load for you. Peter Wolanin wrote:
Does anyone know if any core module uses the 'mode' column in the {users} table? A quick search with grep didn't turn up anything so I was thinking about using it as a flag for per-user behavior for a custom module for a little site.
-Peter
On 13 May 2007, at 02:26, Peter Wolanin wrote:
Does anyone know if any core module uses the 'mode' column in the {users} table? A quick search with grep didn't turn up anything so I was thinking about using it as a flag for per-user behavior for a custom module for a little site.
It belongs to the comment module -- it used to store the comment viewing mode (i.e. threaded, flat, nested, collapsed). If that's no longer used, we can remove it from the users table. -- Dries Buytaert :: http://www.buytaert.net/
On 5/14/07, Dries Buytaert <dries.buytaert@gmail.com> wrote:
On 13 May 2007, at 02:26, Peter Wolanin wrote:
Does anyone know if any core module uses the 'mode' column in the {users} table? A quick search with grep didn't turn up anything so I was thinking about using it as a flag for per-user behavior for a custom module for a little site.
It belongs to the comment module -- it used to store the comment viewing mode (i.e. threaded, flat, nested, collapsed). If that's no longer used, we can remove it from the users table.
And when Dries says "we can remove it from the users table", he means "this is a good opportunity to roll a core patch" :P -- Boris Mann Office 604-682-2889 Skype borismann http://www.bryght.com
participants (5)
-
Boris Mann -
Dries Buytaert -
Khalid Baheyeldin -
Moshe Weitzman -
Peter Wolanin