Like stackoverflow.

Comments

locomo’s picture

Integration with Node Comment (http://drupal.org/node/966180) might be another way to approach this?

jcisio’s picture

Just add a note that I've created another module to force to two levels of comments. Adding this feature could be simple, however I just don't need it now and I don't have time to work on it.

ec’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Assigned: Unassigned » ec

Hi, I will roll a patch for this for the 6.x as soon as the other patches get in or are definitively postponed. My proposal is adding a new settings to let the admin decides whether he/she wants the top level comments only or not. And then it checks if the $comment->pid == 0. It also takes into account the use of the duration feature.
Best,
EricC

jcisio’s picture

This is definitely a good feature. I'd like to see it in 7.x branch first, then backport. However, there is no problem if we get it in 6.x first. The proposal on a option in the settings page looks good.

Why do we need to check the duration in this patch?

ec’s picture

Well, when we use the duration, the system will automatically choose the best answer among all the comments if none has been selected by a human being. Hence, if the admin decides that only top level comments can be selected by a human being I suppose that the automatic system should have the same behaviour. So we need to filter the top level comments before computing the votes.

jcisio’s picture

Ah yes, I understand it now. Thanks.

jcisio’s picture

Hi ec,

Have you progressed on this? Do you mind uploading your work (or work on progress)? I'd like to get it in then roll out 1.7 versions.

ec’s picture

StatusFileSize
new4.75 KB

Yes ;-) here is my patch for this new feature. As previously said, there is a new setting and for consistency I take care of what happened with the automatic selection of a best answer when a duration is in place. let me know. Best.

jcisio’s picture

Status: Active » Needs work

- We'd prefer 1/0 to yes/no for variable value.
- I don't see why we need 'required' => false.
- I think we need to patch question_answer_action_access() instead of hook_link(), it'd be easier and cleaner. We don't have to check "question_answer_action_access('deselect', $object, $node) && $object->pid == 0" because even the option is active, it could happen that a non-toplevel comment was selected when that option is not active, and now it could not be deselected.

ec’s picture

StatusFileSize
new4.19 KB

Hi,

Thanks for your comments!

- We'd prefer 1/0 to yes/no for variable value. ok done.

- I don't see why we need 'required' => false.

Well for me this is an optional feature hence it shouldn't be required. We just need a default value compatible with the settings of the previous version.

- I think we need to patch question_answer_action_access() instead of hook_link(), it'd be easier and cleaner. yes good catch.

- We don't have to check "question_answer_action_access('deselect', $object, $node) && $object->pid == 0" because even the option is active, it could happen that a non-toplevel comment was selected when that option is not active, and now it could not be deselected. ok done.

Find attached my new patch to adress these issues.

Best,

ec’s picture

Status: Needs work » Needs review
jcisio’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Fixed a few wording (even I'm not an English native speaker ;)), coding standard, inverse the condition in the duration formatter (I think you made it wrong). Committed http://drupalcode.org/project/question_answer.git/commit/e9b544a.

Let's test and port to D7 so that we could release both 6.x-1.7 and 7.x-1.7.

jcisio’s picture

Status: Patch (to be ported) » Fixed

http://drupalcode.org/project/question_answer.git/commit/f20f350 for D7.

If you have time, please test for both. I think I'll roll out new release this weekend (two years after the last stable releases).

Status: Fixed » Closed (fixed)

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