I am setting up an Advice column (sort of like "Dear Abby") and FAQ does almost everything I need; with the Subscriptions module I'm 98% there. But I need to be able for the user to be able to ask a question, then have the expert ("Abby") answer at some other time. Unfortunately, the answer field is required and cannot be left blank.

I'm thinking of a small hack to add a default value on the entry form to set it to "Waiting for an answer." I'm not super happy with this as I have other FAQ categories that shouldn't be this way. Can this be done in a more "elegant" way?

BTW, when I'm done, I intend to create a "How To" page in the Handbook because I think a lot of people might like to have a advice, or "ask the expert," feature.

Comments

stella’s picture

You should check out the Question module. I contacted the maintainer a while back about integrating the two modules to provide such a feature but never heard back. I'll follow up on that again.

Cheers,
Stella

NancyDru’s picture

That looks promising, but I want this part to happen without intervention: "Administrators can view the queue and choose to create question/answer nodes..." FAQ does this - at least with "Waiting for an answer."

The only other improvement might be setting the question unpublished until it's answered. Actions/Workflow might be able to handle this.

stella’s picture

Assigned: Unassigned » stella

Hi Nancy,

I'm also going to address some of the issues raised in your Ask the Expert article if you don't mind. The "waiting for an answer" hack is definitely not ideal and hopefully we can come up with an alternative solution.

  • Set FAQ to non-published - I believe this could work. However, it means that your experts have to have the "administer nodes" permission in order to publish the FAQ once they've answered the question. This means they can administer other content on the site too, not just FAQ nodes. Is this something that you think would be acceptable? Perhaps Actions/Workflow can help, but I'm not familiar enough with them to say.
  • Preselected category - I've tested this out and technically it is possible to get a predefined tid from the url, e.g. node/add/faq/123. However, I'm very reluctant to do this as I feel it is very much a hack and probably wouldn't be approved of by drupal maintainers. I don't know of anything that says we can't or shouldn't do this, I just think we couldn't always rely on it to work. I'd be much more in favour of just allowing the user to select the appropriate term from a list.
  • Better solution for unanswered question - Yes, something would need to be done in order to handle this.
    • One way is to collaborate with the maintainer of the Question module. This solution allows us to just link to the existing 'ask the expert' form which will put the question in a 'to-be-answered' queue. Ideally, functionality would be added to the Question module to port answered questions to faq nodes.
    • An alternative solution would be to create a new permission, e.g. 'create unanswered faq'. If a user has this permission (and not 'create faq' or 'edit faq') then they could create a FAQ node but the answer box wouldn't be displayed on the form. An expert with 'edit faq' permission could then edit the node, but would see the answer box and could fill that in. The published/unpublished bit would still be controlled in the normal way and experts would need the "administer nodes" permission to publish them (assuming default is unpublished).

Thoughts? Comments?

Cheers,
Stella

NancyDru’s picture

Wow, Stella,

I believe I mentioned in the article that you are one of the most responsive module owners, but this is incredible!

Indeed my hack is not something I like to do or really want to maintain. On the other hand, I'm not crazy about asking you for any more settings or permissions.

  • Set FAQ to non-published - "means that your experts have to have the 'administer nodes' permission" Oops - I hadn't thought that one all the way through. No, this is definitely not wanted. My first expert is not even a member of the group that wants this feature. I had to create a new role and carefully limit her access just to get this far.
  • I'm pretty sure I've seen postings that said Actions/Workflow would be able to do this, but I've not used them yet.

  • Preselected category - "I've tested this out and technically it is possible... I'm very reluctant to do this ... probably wouldn't be approved of by drupal maintainers." I agree with you on this. I would be interested in the details (privately) - perhaps a "legal" way could come from it.
  • Better solution for unanswered question -.
    • "...collaborate with the maintainer of the Question module." This has a lot of merits. However, it would still leave me without the notification ability. I also have serious doubts that such collaboration will come about. I have given some thought to writing my own "skinny" version of it specifically to front-end FAQ and with notification built-in. This won't happen quickly though.
    • "new permission" - I really like this idea (why didn't I think of it). But we get back to my reluctance to ask for something like this. However (putting my dreamer hat on), even better would be 'create unanswered ttttttt' where ttttttt is the term name, rather than a global setting for all categories (I have 4 other categories right now that shouldn't have this allowed).
NancyDru’s picture

Having had a bit more time to ponder and experiment, 'create unanswered faq' is definitely a good thing. I had to open "create faq" up to a lot of people I didn't want to have it (which probably means I'll have to check if with the Spam module). I don't think I mind these people having "edit own" - at least until the question is answered.

I'm beginning to think the Question-type front-end is a better way to go. I'm going to have to spend a little time designing it. If I remember correctly, an "faq" is pretty much a standard story node with the question as the title and the answer as the body. So, rather than "node/add/faq" I could create a node object and save it, then allow the "expert" to edit it. If it's marked unpublished I think Subscriptions will still notify them. And a simple "WHERE status=0" query would show them the "queue." This doesn't sound terribly complicated.

stella’s picture

Can you tell me more about the Question-type front-end you're creating? I don't completely follow how it will work. Is it a patch to the Question module?

The main problem with creating unanswered question nodes is the published vs unpublished thing, which is why the "Question" module is better in this regard. This is because the unanswered questions aren't nodes and are put into a queue where anyone with the appropriate permission should be able to create nodes from them once answered. I don't think I can (or should) create a permission that controls who can change the published status of a faq node. However, there are somemodules out there that might be able to do this, or could with a patch: Node Approval, Override Node Publishing Options or modr8 to name just a few I found on a quick search.

Cheers,
Stella

NancyDru’s picture

First, I'm not married to the idea of a new module. If there are better ways, I'd like to investigate them.

If I create it, it will be from scratch and only for FAQ. It would operate as an add-on. I believe the module can change the published status without regard to the permissions (so I will have to make sure I know who is doing it). I'd like to accomplish this without resorting to any other module dependencies.

My initial thoughts are:

  1. Have a menu item for "Ask the expert" that creates the question.
  2. Add a tab to FAQ for the settings, if there are any. (This is easy.)
  3. Create a block that shows unanswered questions to the expert, or to a user with any of the rights to edit it. (I've done this before, so this is not difficult.)
  4. When the expert (as opposed to anyone else) clicks on a question in the block, I would set it published, then it would go to your edit screen.

Right now, I'm still struggling with how to associate experts with categories. I'd rather avoid creating a table, but I may have to. And that means another form to link experts with categories. This might, however, remove the need for Subscriptions since I'd be able to get the expert's email address(es) from the Users table.

stella’s picture

For associating experts with categories/terms, check out the following modules: Taxonomy Access Control, Taxonomy Access Control Lite, Taxonomy Role and Vocabulary Permissions.

Most of these do it on a user role basis - depending on the number of experts this may be suitable. However, the Taxonomy Access Control Lite one also allows you to grant permissions per user, i.e. give a specific user access in addition to what his/her roles allow. This might be more what you are looking for.

I'm happy to add "unanswered questions" support to the FAQ module. It's just a matter of deciding what's the best way (and most extendible way) to do it.

Cheers,
Stella

NancyDru’s picture

I have this part handled. I really don't want to require any additional modules.

Thanks for the offer, but I don't think I'll need the added permission. I'm nearly finished with this; I will email it to you for initial testing when done.

NancyDru’s picture

Assigned: stella » NancyDru
Status: Active » Needs review

My article,"Ask the Expert" or Advice Column, is now published on DO.

The FAQ_Ask module to implement this feature is now available separately and is looking for beta testers.

stella’s picture

Status: Needs review » Fixed

This feature is now provided by the FAQ Ask module, so closing this issue.

Cheers,
Stella

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.