I'm trying to get tinyMCE set up for several different user roles, and I've noticed something frustrating: As best I can tell, the way the DB is structured (at least for mySQL) code loads the profile for the lowest numbered Role ID associated with some profile. This means (in partiucular) if I enable a profile for authenticated users (rid == 2), then I apparently can never access any other profile when logged in to an account with an additional user role that I want to have additional editing options.
The attached patch tries to address this problem by selecting the last profile returned, rather than the first profile returned.
I tested this with drupal 4.7.1, PHP 4.4.2, mySQL 4.0.25 and it seems to work as expected. Please check it out. I especially want to be sure that the behavior is the same with PostgreSQL and MySQL 5.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | tinymce_4.module | 42.79 KB | pwolanin |
| #1 | tinymce-higest-role_patch_2.txt | 1.39 KB | pwolanin |
| tinymce-higest-role_patch.txt | 1.52 KB | pwolanin |
Comments
Comment #1
pwolanin commentedHere's a second go at the patch. I think this is even better- I changed and simplified the query (I don't see why the INNER JOIN is necessary), and I have it ordered "ORDER BY rid DESC". Thus, the behavior should be DB independent and independent of any DB table structure.
Tested and seems to work as expected. Please test and get back to me on whether this is desirable and RTBC.
Comment #2
pwolanin commentedThe entire patched module (per patch #2) also attached for those without ready diff/patch access.
Comment #3
pwolanin commentedI have been using this version for several weeks, and it works fine. Maybe could be combined with the notion of using user role weights as suggested: http://drupal.org/node/60667
Comment #4
Tobias Maier commentedyour right your version is really simple - but you pay this simplicitiy with inflexibility...
to be inflexible is not a drupalish aproach -> so it is not good
Comment #5
pwolanin commentedYes- I agree it's inflexible, but it easily allows one to have profiles for 1) anonynous users 2) authenticated users 3) users with an additional role. I think this could be combined with additional, simple, code to use the role weights from the role-weights module if it is installed. Then admins who need additional flexibily can use role weights.
Comment #6
pwolanin commentedMakrking as duplicate- please look at the patch above, but follow-up to the discussion at: http://drupal.org/node/60667
Comment #7
geme4472 commentedThanks for the patch pwolanin. Simplicity is one of the characteristics that makes good systems great. In this particular case, it made a good patch great. As far as the naysayers go, a patch is a patch, and until tinymce.module fixes this bug, it's still a hack (even if contrib). Nicely done.
(Still a duplicate, please look at the patch above, but follow-up to the discussion at: http://drupal.org/node/60667)
Comment #8
neveo commentedI am trying to get the tinyMCE module up and running. I was able to install it and can make changes, but when I click preview at the bottom of my content page it strips away any style that I applied to the body of the textarea; do you know why this is happening. I have also played with three other editors and they are strip away styles. Can anyone help?
Thanks,
Comment #9
husztisanyi commentedMaybe, solution: http://drupal.org/node/181798#comment-792447