I have many roles with complicated role names, and this breaks the HTML when I save the settings form:

<div id="edit-google-adwords-track-Medlem,-æble.dk-wrapper" class="form-item form-option">
    <label for="edit-google-adwords-track-Medlem,-æble.dk" class="option"><input type="checkbox" class="form-checkbox" value="1" id="edit-google-adwords-track-Medlem,-æble.dk" name="google_adwords_track_Medlem,_æble.dk"> Medlem, æble.dk</label>  </div>

I think you should switch to using role id, as seems to be the standard in e.g. the googleanalytics-module. As it is now, I am unable to enable Adwords tracking (via the UI) for roles with a dot in their name.

CommentFileSizeAuthor
#2 use_rid_not_role-1127148-2.patch2.64 KBfirebus

Comments

firebus’s picture

+1 role id should be used here, not role name

firebus’s picture

Assigned: Unassigned » firebus
Status: Active » Needs review
StatusFileSize
new2.64 KB

here's a patch that replaces role with rid.

there's also an update hook to update variables for existing users.

finally i replaced the db_query select on {roles} with a call to user_roles()

jasonsavino’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Assigned: firebus » jasonsavino
Status: Needs review » Closed (fixed)

patch tested and committed to dev branch