Basically I really need to be able to have everyone in a role be allowed to answer question and get emails when one is submitted.

Therefore, I am writing an update patch that will change the configuration section to also allow a whole role to always be assigned as experts to a category.

My first thought on how to do this was to continue to use the faq_experts table already being used and just lazily adding (uid,tid) values to it for new users in the role and new terms whenever this information would be needed.

However, I think a better solution may just be another table linking roles to terms, or an update to the currently used table to have 4 rows: User ID, role ID, Term ID, and a boolean to represent whether to use the user, the role, or the user ONLY if he is still of the role. This last one is in case the user is no longer of the given role (this may be unnecessary, so I am hoping for input).

maybe:
0 -> user
1 -> role
2 -> user only if he is still of the given role

Anyway, I don't mind making the patch, as I need to make it for myself this week or next anyway. So, any input on the change to the table? or the addition of another (a short term solution in my opinion)?

CommentFileSizeAuthor
#3 myupdate.diff17.48 KBkuzma

Comments

kuzma’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

With a flag to indicate which type the entry is, you really wouldn't need user id and role id to be separate columns as they have the same format. If you do this, I would have a problem with "user only if he is still of the given role;" either it is for a role or it is for a user. I do not like the hybrid option, even though it would be the easiest to implement.

kuzma’s picture

StatusFileSize
new17.48 KB

Okay,
so I have a patch now, and it is significant in size. I agree with you on going all user or all roles, NancyDru. I chose roles, and that is what this patch does. It changes the table, the forms, a great deal of the SQL, and a lot of code in random places to make up for the difference.

It isn't perfect yet. Namely, I have one error I am having trouble tracking down:
The default expert role selector doesn't appear until after the settings form's Experts tab has been saved once.
I have a feeling that this is an obvious fix in the hook_form, but right now I will concentrate on something else:
Now that the alpha is out and the release notes led me to believe that it is almost a rewrite, so I will instead focus on making a patch for that.

Anyway, if you are curious about the results that I am aiming for, the patch is attached.
I will soon create a feature request ticket for the alpha version on this.

kuzma’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

I am closing this issue and creating a new one for the alpha version.