The settings page of the module appears once for every tab present in the user edit page.
That is because the function preferred_format_user() miss an argument which is passed from Drupal 6.
The exact declaration of the hook is the following:
hook_user($op, &$edit, &$account, $category = NULL)
where $category is a category which has been declared by the module in the same hook, or it's an existing one (i.e. it could be "account", which is the first tab presented when editing an user account.
In the second case, the code should be something like:
if ($op == 'form' && $category == 'account') {
// Create the form field you want to add to the page.
// ...
return $form;
}
It would be preferable to use a different category, so the user could know it can set his preferred filter format without to look at the end of a long page. In this case, the user could notice he has something more he can set.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | preferred_format_categories_78163.patch | 7.58 KB | avpaderno |
| #2 | preferred_format_categories_78148.patch | 7.55 KB | avpaderno |
| #1 | preferred_format_categories_78120.patch | 7.2 KB | avpaderno |
Comments
Comment #1
avpadernoI made a patch to resolve the issue.
Comment #2
avpadernoI misunderstood on "linear array of associative arrays"(hook_user). It seems the format of the array must be something like
The new patch changes that.
Comment #3
avpadernoWhoops. The patch also changes the name of the permission used by the module, which includes an useless "can" (see #284885: Change the name of the permission).
Comment #4
avpadernoComment #5
reikiman commentedSubscribing -- so, this is a known serious problem, there's a known fix for over 6 months, and it's not applied? I'll check out the above patch and see if I like it. Is the module maintainer present?
Comment #6
avpadernoThe last time a new code revision for the Drupal 6 branch has been submitted was less than a month ago.
If you want to look to an alternative, you can look at Better Formats.
Comment #8
gdevlugt commentedA very, very belated fix for this issue, available in the latest 6.x-1.x-dev version.
Many thanks to kiamlaluno for the patch which introduces a separate user edit category tab for this module. However, I decided not to include it because this (small) form belongs to the account tab. Also, too many tabs might break up some themes and may clutter the tab menu options.