When any user submits a FAQ Ask, you get this error:

Fatal error: [] operator not supported for strings in /sites/default/modules/faq_ask/faq_ask.module on line 463

Comments

Anonymous’s picture

Line 463 is a comment line? Could you post the line?

Though in line 444:

      if ($params['category'] == -1) {
        $body = t('The following question has been posted.', NULL, $language->language);
      }
      else {
        $body = t('The following question has been posted in the "!cat" category.', array('!cat' => filter_xss($term->name)));
      }

should perhaps be:

      if ($params['category'] == -1) {
        $body[] = t('The following question has been posted.', NULL, $language->language);
      }
      else {
        $body[] = t('The following question has been posted in the "!cat" category.', array('!cat' => filter_xss($term->name)));
      }
kuzma’s picture

Line 463 isn't a comment line.
Line 463:
$body[] = $params['question'];

The reason you get that error is because $body was set to a string in lines 457 or 460, as tirsales pointed out.
Therefore, on 463 it tries to index the string with [] and set it, which raises the error.

That is why changing the lines exactly the way tirsales does fixes the problem.

Anonymous’s picture

Status: Active » Needs review

Oh well, line-counter ;) Seems or editors disagree on them ;)
Glad it worked though.

mdowsett’s picture

Status: Needs review » Reviewed & tested by the community

that did work! fantastic.

Does a patch need to be created (I have no idea how to write one).

Anonymous’s picture

The CVS-Head uses a scalar $body, so there is no need for a patch (against CVS).

nancydru’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks for catching that typo.

Status: Fixed » Closed (fixed)

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