Download & Extend

Redirecting from faq to node/add/faq?ask=true

Project:FAQ_Ask
Version:6.x-2.0
Component:Code
Category:bug report
Priority:normal
Assigned:stenjo
Status:closed (fixed)

Issue Summary

When I upgrade FAQ_Ask from 1.2 to 2.0 my link at www.mysite.com/faq is automatically redirected to www.mysite.com/node/add/faq?ask=true
Effectively this disables my FAQ page :-(

What have I missed here?
FAQ module version 6.x-1.8
PHP version is 5.2.10 and MySQL version is 5.0.77.

Comments

#1

I experience the same redirection, except for some reason this takes me back to my 'home' (node) page. I didn't upgrade, however, but a first install of FAQ and then FAQ_Ask. I fulfilled all of the requirements for it's operation according to the directions, etc - and having fulfilled these, went to try it out. When I click "Ask a question", it takes me to the front-page and the address bar shows the same address... www.mysite.com/node/add/faq?ask=true Am I doing something wrong? Is there a way around this? I'm fairly new in Drupal (about 9 months) so it may very well be my own error, but as was said above - "What am I missing here?"

#2

I tried to add the FAQ-Ask block and now I cannot access the site.

In IE it just loads indefinitely.

In Firefox, I get the following error:
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

It doesn't matter what page I try to access and whether I'm logged in or not.

I deleted the entry for this module in the database, re-enabled the module and got the same issue.

Every page I tried to manually browse to would give me the error.

Removed it again via database, re-added, and I got an error about the tables already being created, but then it worked.

*shrugs*

#3

Same happening for me. Looks like the problem is in the "ask a question" block the module creates. Causing a redirect loop. I commented out some lines there and added a break to that switch statement. Line 865 in faq_ask.module:

case 1:
          // Ask a question block.
/*
if (user_access('ask question')) {
$block['content'] = faq_ask_page(NULL);
}*/
break;

This fixed the issue. That particular block is not really needed anyway, just create a menu item to allow people to ask a question. Have it point to "faq_ask" (that's the Drupal path). Works for me.

#4

This fixed my problem. Thank you.
I would actually have drilled down into the block implementation at some point to find the root cause of this, but I realize that I really do not need the ask block at all. The limitations with it causes users to create long questions that are used as node title and I have to edit it all before it is passed to the expert for answering.
This looks good.
Now, the problem that appears is the one listed in Role with "ask question" cannot ask
- but that is another issue.

Thanks again.

/Sten

#5

A quick look into this and to me it seems that this is an error by design.
Basically when the Block is enabled, the returned value of faq_ask_page(NULL) is added to the output. The problem is that

<?php
faq_ask_page
(NULL)
?>
calls
<?php
drupal_goto
()
?>
that in effect redirects directly to 'node/add/faq?ask=true'
Does anyone know why this is designed that way?
/Sten

#6

subscribing

#7

I just tried your 'fix' - made sense to me, so I gave it a shot, however - after adding the menu item to 'faq_ask', and then clicking on that STILL sends me to the front (node) page. But then again - I seem to be having troubles with similar behaviors elsewhere too. I'm so dog-gone frustrated, I'm about ready to throw either the computer, or Drupal out the window (probably not the computer - too expensive). -- I sure wish I had someone to "faq ask" questions to, and get some answers &/or direction. It is HARD to be a 'newbie' with Drupal - no one wants to help a 'newbie', it seems, and the only books on Drupal I can afford are so old, most of the needed info is outdated. -- As for the "FAQ Ask" -- like I said, still sending me to the front-page (node). Any more ideas ? --- For that matter, while I'm throwing out a question... I've spent months building a "Community" site, and now find that the only one who can access the "Community" areas, are "user-1". I've checked blocks, permissions, every module I can think of that might cause this -- but even another user with FULL permission can't go to such things as the "Guestbook" (module), or the 'og' Groups (and see the list of groups). Any friendly (and knowledgable) people out there willing to help out a "newbie" before he throws a noose over the nearest tree-limb and hangs Drupal (or himself) ??? Thanks for reading - and I'll be EVER THANKFUL if someone could help.

Lee-vit-Over@hotmail.com

#8

I have spent some time creating a patch to fix this. Posted under #421818: Faq_Ask block redirects
/sten

#9

A simple hack that worked for me is to not call the offending faq_ask_page(NULL) function but to create a link to the ask page manually:

case 1:
          // Ask a question block.
          if (user_access('ask question')) {
$block['content'] = '<ul class="block"><li><a href="'.url("node/add/faq?ask=true").'">Ask a question</a></li></ul>';
          }
          break;

#10

Assigned to:Anonymous» stenjo
Status:active» fixed

Actually the patch I've written and uploaded in #198828: Notify Asker on answer fixes this and a few other problems I've had :-)

#11

Status:fixed» closed (fixed)

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

nobody click here