Hi,
I don't know what your status is on porting this module to Drupal 6.x, but I'd love to collaborate with you, if you're already working on it. Otherwise, I'm going to work on it myself because I need to use it for my site. I'd love to help you maintain the module as well if you're interested.

Thanks!
Rene

Comments

ZenDoodles’s picture

Title: May I upgrade to Drupal 6.x? » May I upgrade your module to Drupal 6.x?
amanuel’s picture

rsoper,

I'd welcome help.

Thanks.

sedmi’s picture

When could we expect this module to be available for Drupal 6.x?

inders’s picture

Issue tags: +answers, +answer module drupal 6, +drupal 6 answers

Hi,

I have Drupal version of it . but how can i upload to CSV or upload somewhere so that it become available for download on public project page?

Thanks & regards
-Inder Singh

http://indiapoly.com/
http://inderweb.com/

lelizondo’s picture

inders, I'm interested in trying the 6.x version of this module, but before the maintainer of this module gives you access to the CSV you'll have to publish the .zip file with the module here so the community can try it before you commit it, that's just the way it works.

Please do so the rest of us can try it and see if it really works. If is stable enough the maintainer can commit it, if the maintainer has abandoned the project then it could be possible to create a new project with your module.

inders’s picture

StatusFileSize
new21.03 KB

Hi,

I am attaching my drupal 6 working version of answers module. Please let me know if anyone have issue while using it.

YOu will need to enable both modules to be enabled
1)Answers
2)Simpleanswer

After enabling this module just needed to configure it from admin page.
E.g:-
http://indersingh.com/admin/settings/answers

Working demo:-

http://www.indersingh.com/askq/new

I hope this module is useful for somebody...

I Can be contacted for further modifications or upgrades.

Thanks & regards
-Inder Singh

http://indiapoly.com
http://indersingh.com

-Always enjoy My work.....

inders’s picture

Assigned: Unassigned » inders
Category: feature » task
dewbie’s picture

Hi Inder

Thanks a lot for posting answers module. I could not locate the Simpleanswer module for D6.x. Could you please give that link aswell?

Thanks

lelizondo’s picture

Status: Active » Needs review

the simpleanswer module is inside the .zip @inders provided. I'll give it a try tomorrow.

We have a patch so is time to review it.

prokopton’s picture

That looks awesome!

Great job, Inders!

JeremyFrench’s picture

Subscribe

skizzo’s picture

@Inders: thank you for making the unofficial D6 version available! Occasionaly, when answering a question I get an error page: Remote server or file not found (with Opera). I don't think it's a glitch in the network, as the httpd logfile reports:PHP Fatal error: Unsupported operand types in /var/www/drupal/includes/common.inc on line 1386, referer: http://chips.yagoo.me/en/node/add/simpleanswer/6166.
It does not happen consistently, but maybe you or the maintainer(s) can spot the problem just looking at the code?

skizzo’s picture

also, I noticed that:

- I am not getting any e-mail notification (as required on post) when answer is added
- I am not seeing the answers total in node links (as configured in settings)

are those working for you?

inders’s picture

Hi,

YOu can check mailing implementations at:-

Line 218 answers.module

if($questnode->notifyme) {
           answers_notify($node->questid, $questnode->title);
        }

and

Line 239 answers.module.

function answers_notify ($nid, $title, $style = 'answer') {
  $subj = $title;

I will try to get time for checking it if not found.

Thanks & regards
-Inder Singh

http://indiapoly.com
http://indersingh.com

- Time Is everything...

Stomper’s picture

Thanks for porting to 6.x. Really appreciate it.

thegamecat’s picture

Hi, Inders great job releasing this on v6.

I've fixed the problem with the error:
PHP Fatal error: Unsupported operand types in /var/www/drupal/includes/common.inc on line 1386, referer: http://chips.yagoo.me/en/node/add/simpleanswer/6166

Go to answers.module line 248 and paste this over it:

//$body = t($message, array('%name' => $cuser->name, '%addername' => $user->name, '%ansertype' => $style, '%title' => $subj, '%url' => url('node/'. $nid, NULL, NULL, 1), '%site' => variable_get('site_name', 'drupal')));
$fixarray = array();
$body = t($message, array('%name' => $cuser->name, '%addername' => $user->name, '%ansertype' => $style, '%title' => $subj, '%url' => url('node/'. $nid, $fixarray), '%site' => variable_get('site_name', 'drupal')));

The problem was caused by the incorrect use of the url() function - it expects a second parameter of an array. I don't believe any of the array members are relevant to answers so I've made a blank array instead and passed that in.

thegamecat’s picture

Additionally the email send is actually the old drupal5 code - so I've modded that:
(bear in mind I'm lazy as hell so rather than worrying about the drupal_send function I've gone for the simpler drupal_mail_send.

If anyone knows what the $user email address is please respond :P

$message = array(
'to' => $cuser->mail,
'subject' => $subject,
'body' => $body,
'headers' => array('From' => $user->email),
);

drupal_mail_send($message);

// $mail_success = drupal_mail('answers_notify_email', , , , variable_get('site_mail', NULL), $headers);
// if (!$mail_success) {
// watchdog('error', t('error mailing quest notification: ') .'"'. $cuser->name .'" <'. $cuser->mail .'>');
// }

thegamecat’s picture

Oh yes, also worth mentioning that I had to turn off Feed in pathauto otherwise it kept throwing warnings about duplicate urls.

But it does all work now.

sagar ramgade’s picture

Hi,
Thanks for porting this module to Drupal 6. I want to use this module on my site however mails are not working which are very crucial for me to chose this module.
Could you please help with the patch.
Thank you in advance.
Regards
Sagar

chipcleary’s picture

StatusFileSize
new20.64 KB

Hi,

Thanks for providing this!

I wanted to use the module on my site, so pulled together a version that included the patches suggested above. Attached, in case this is useful to others.

Note that in addition to integrating the patches above from thegamecat, I made the following changes:
- Edited the english in forms, menu titles, email templates, and settings
- Edited the function for notification emails works (to get the email notification to work, I had to add the 'from' parameter)
- Changed variables in the email template to use "!" instead of "%"
- Changed method for setting the initial values of the email template
- Changed the name of the package back to the original "Answers"
- Included all contributors in the comments (amanuel (original author), inders (D6 conversion), thegamecat (patches)

Hope this is useful ...

- Chip

sagar ramgade’s picture

Hey thanks for your efforts, I surely try this module.
I am using inders answers module on a live site is it safe to upgrade to your module.
Once again thanks a ton.

Regards
Sagar

chipcleary’s picture

Sagar,

Thanks.

This is the same module as what inders provided, with the list of changes I put in above. So, I imagine it is about equally as safe. It looks like you had problem with mail working ... so did I when I started with inders module plus the patches above from thegamecat. You might check to see if the changes I made can fix your mail problem too.

Hope this helps.

- Chip

slapierre’s picture

Hello,

I just tried the module in answers.zip provided by chipcleary and my Drupal 6.15 site complained about the

function answers_link_alter(&$node, &$links) {

in answers.module. Seems it should be changed to:

function answers_link_alter(&$links, $node) {

Hope this helps!

chipcleary’s picture

StatusFileSize
new20.99 KB

Thanks.

While my site didn't complain, seems like maybe it should have. It appears that this is something that wasn't upgraded yet. Looks like the function call changed btw D5 & D6 however the change hadn't yet been reflected in the answers module.

Now fixed.

As before, new zip file attached in case it's useful to others.

chipcleary’s picture

StatusFileSize
new20.93 KB

So, I wondered today if there was one function that hadn't been updated to D6 whether there were others.

I ran the coder module on it and fixed a laundry list of things it identified.

The module with these fixed included attached (again).

simon georges’s picture

Status: Needs review » Reviewed & tested by the community

Works like a charm !

I just used #25, activate both modules, and everything worked like a charm. I think it would be reasonnable to create a 6.x-1.x-dev, at least to allow more immediate download, there is a little more to do to have a proper release (better theming, for example), but as is, this module is plain usable !

Thanks a lot, everybody !

seaji’s picture

You know, port to D6 is done by me and neochief (co-maintainer) in 2009 but not in CVS yet, so sad.
In Feb 2010 it was updated and now have many good features.
Here is short description:

This module adds a question & answer service to your site.

Users are able to post their question and receive answers from others.

Module supply a basic content type "Question" but administator can allow any
content type to be a question (to do this you have to go to the
'Administer -> Site configuration -> Answers settings')

Answers to questions are "comments" in Drupal workflow scheme, but displayed
and themed differently. And they have some extra propeties. Answer can be
marked as "The Best Answer" by author of question or administrator. Any
queston can have more then one best answer. Best answers are displayed
along with node before other answers. While marking answer as
"The Best Ansewer",  the author of question can add some extra feedback
to that answer.

Users have "Questions" and "Answers" tabs in profiles to track
answers and questions.

User can ask question anonymously if administrator allow this feature.

Module "Answers" inplements hook_votingapi_insert(). If answer get some
voting points it becomes "Top Answer".

UPDATES Feb 2010
- Get rid of notification functionality. Use subscribtions module.

- Added status managment system for questions. Admin can create and edit statuses
  and assine these statuses to questions
  
- Added views integration for questions and answers

- Added two default views: "recent questions" and "recently answered"

- Added hook_answers_mark($nid, $cid) hook_answers_unmark($nid, $cid)
  so other modules can implement extra logic while marking answer as
  "The Best Ansewer" and vise versa.

- Added hook_form_answer_alter($form, &$form_state, $form_id) to change answer form
  you must place your alteration in $form['change_status'] fieldset
  this hook works only for user_access('change question status')
- Added hook_answers_change_status_validate($form, &$form_state)

- Added hook_answers_change_status_submit(&$form, $form_state)
  in the $form_state['values'] array you can pickup values set by hook_form_answer_alter()

I don't know what to do now.

sagar ramgade’s picture

Hi,

Is this the same module in comment#25 ?
Alternative solution will be to create a different project say : Drupal Answers.
How abt this?

Regards
Sagar

All about Drupal
www.drupalearth.com

neochief’s picture

seaji isn't right. It is in CVS for about 2 months. It's 6.x-2.x branch, as our version contain way more improved version answers, which isn't yet ready for production, but it's a future of this module. So I think we could post your version as 6.x-1.0 and be happy with it while we develop 6.x-2.x. But 1.0 will be no improved anymore, all of the new features will be in 2.x. This may work for everybody.

seaji’s picture

I think use of branches 6.x-1.x and 6.x-2.x will be fine

chipcleary’s picture

My two bits is that this seems like a smart solution. Would you like help working on the 6.x-2.x branch?

seaji’s picture

I'm working hard on 6.x-2.x branch now.
Finish is near.
Views integration take much time.

inders’s picture

Hi,

seaji I think you guys can release dev version of drupal 6x answers module at project page.
That will be nice for all community.

Thanks & Regards
-Inder Singh
http://indersingh.com

seaji’s picture

There is no migration from 1.x to 2.x branch for now.

simon georges’s picture

For those who are looking for a solution while waiting for the Drupal 6 (or 7 ;-) ?) version of the module, you can find a working feature at http://community.featureservers.org/project/answers.

Best Regards,

yankeesrock1423’s picture

I am currently using the version found in #25. All seems to work fine, except that when I try and edit and/or delete the answers that are posted with simpleanswer I get a page not found error. Any ideas?

dipole’s picture

Thank you so much for this module... a real life saver.

chipcleary’s picture

StatusFileSize
new7.56 KB

Hi all, in #35 above, Simon Georges points to a answers module which is based on using the Features. This, written by Greg Harvey, provides a workable, simple solution.

One drawback it has is that it does not support automatic notification by email (In the original module, if I ask a question and you answer it, then I can get a notification email.)

I have taken the solution in #35 and added a small amount of code to support notifications. This updated version of the module is now attached ... it is substantially similar in functionality to what I had posted in #25 awhile back but simpler to maintain (requires <2 pages of code).

Please find attached. See the file "answers.guide.txt" for a description of the functionality provided and how to install and use it.

Stomper’s picture

You can similar functionality using a custom question and answer content type. Using node reference by url module as well as enabling node (answer and question) from a block, you can get similar results.

Also, using the node reference count module, you can display the number of answers to a question in a view

chipcleary’s picture

Yep, Stomper is correct in comment #39.

In fact, that's how how the module was built (although using views instead of blocks). That's the nice thing about the Features module ... you can take site configurations like this and make them into reusable modules.

The version in #38 then goes one step further to support notification emails.

chipcleary’s picture

StatusFileSize
new7.83 KB

Here is an updated version of the module in comment #38 above.

It fixes a bug with permissions that prokopton caught in #1079570: Permissions issue with 6.x version. The bug was that even anonymous users could ask to be notified by email of responses to their questions. This is not possible since we don't know their email). In the new version, that option is not offered to anonymous users.

prokopton’s picture

Chip,

I have problems upgrading to the new version on Drupal 6.20. When I ask a question, there's no subject box or body.

Also, when I run "update.php", the answers module isn't available in the list of options.

prokopton’s picture

When I downgrade, the links are gone (/askq ).

I'll wait. No rush.

chipcleary’s picture

Hi prokopton,

Can you provide a little more detail about what the issue is? I am using drupal 6.20 and not able to replicate what you seem to be seeing.

As one bit of information, when I built the module, I left the list of questions at the path "/questions". Unintentionally not the same as the initial implementation.

It may be that after upgrading, you need to redo some of the initial configuration work. From the "answers.guide.txt" document in the module ... to set up the module:
• Install the module
• Enable page counts: go to "admin/reports/settings" and set "Count content views" to "enabled"
• Enable vote up/down on answers: go to "admin/settings/voteupdown/node" and set the checkbox under "Node Types" for "Answer"
• Configure the administration options (see "Administrator Role" above)
• You may want to disable the menu item Navigation -> Create Content -> Answer (since it is unlikely you want answers to be created directly, instead of in response to questions)

Thanks.

prokopton’s picture

Hi Chip,

Please give me a few days as I was in a rush when I did the upgrade. I'll be sure to follow the steps you listed.

I'm extremely grateful that you and other developers make great software for the community. Thank-you.

prokopton’s picture

Hi Chip,

I think it might be changes in the links that I'm not aware of. So,

old new
---- ----

/askq --> /questions

/askq/new --> ???

/askq/uans --> ???

Thanks.

lelizondo’s picture

Why haven't anyone created a new sandbox project with this code? Wouldn't it be easier? Anyone can do it. It would be easier to fix individual bugs.

chipcleary’s picture

In response to #48 above, this suggestion makes good sense. I've taken it up.

The version I had provided in #44 above is now available as a sandbox project. Please see http://drupal.org/sandbox/chipcleary/1090740.

As prokopton has noted, the version I have provided is not currently backwards compatible with the links in the original version. It makes sense to make it so (I just hadn't done it so far because that was not important to me). Good suggestion, thanks!

To keep track of this suggestion, I added an issue to the sandbox project for it. I will work on extending the version I provided to support backwards compatible links.

lelizondo’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @chipcleary. I think we can finally close this issue and move further issues to http://drupal.org/sandbox/chipcleary/1090740

Status: Fixed » Closed (fixed)

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

chipcleary’s picture

Note, the D6 version is now available from this project. No need to go to the sandbox.