The category accordion method is failing.

I've established a taxonomy of 11 terms, each with 1 to 10 associated FAQs. I've inserted a block, rendering php code, as per instructions for D7, to insert the FAQ into a section of the page. Note: I receive the same result whether I use the defaults for FAQ, i.e.,
print faq_page(NULL, 'hide_answer', 'hide_qa');
or
print faq_page(NULL');
The questions/answers show/hide as expected, but the categories fail to do likewise. All of the categories render with their respective questions visible, though I've enabled the accordion effect for categories.

Neither Chrome nor Firebug report js/css 404's nor javascript errors on execution through the page. I'm not sure, but it seems the // Hide/show q/a for a category function starting on line # 191 is not fully triggered?

Clicking on the category headers does add a class tp the category header, i.e., it toggles between "faq-header faq-processed" (when loaded) and "faq-header faq-processed faq-category-qa-visible" (after clicking) however, the following "div.faq-qa" does not change visibility or display attributes.

Comments

seanburlington’s picture

Version: 7.x-1.x-dev » 7.x-1.0-rc1

I'm getting the same problem

marking this as 1.0-rc1 because the bug seems to have been introduced at the time of this release

it was not present previously in the dev version

Screenack’s picture

I have seen this behavior/problem in both versions, btw.

rogerkemp’s picture

Same problem here.

seanburlington’s picture

Status: Active » Needs review
StatusFileSize
new2.46 KB

The attached patch seems to solve the problem for me

The divs are class=faq-qa but the javascript was acting on div.faq-qa-hide

I adjusted the javascript

Screenack’s picture

Sean: works GREAT here, much thanks for the fix!

palmaross’s picture

I suggest also remove lines 148-152 and 199-203 from faq.js in order to when you close question or category your screen didn't jump up:

lines 148-152

        if (faq_hide_qa_accordion) {
//          if ($('.faq-qa-visible', context).offset() != undefined) {
//            $('html, body', context).animate({
//              scrollTop: $('.faq-qa-visible', context).offset().top
//            }, 1);
//          }
          $('div.faq-dt-hide-answer').not($(this)).removeClass('faq-qa-visible');
        }

lines 199-203

        if (faq_category_hide_qa_accordion) {
//          if ($('.faq-category-qa-visible', context).offset() != undefined) {
//            $('html, body', context).animate({
//              scrollTop: $('.faq-category-qa-visible', context).offset().top
//            }, 1);
//          }
          $('div.faq-qa-header .faq-header').not($(this)).removeClass('faq-category-qa-visible');
        }
nalan’s picture

Will this patch work for V6?

Screenack’s picture

Noting that the 2011-Nov-12 7.x-1.x-dev update breaks this patch; had to revert to the 2011-08-31 and reapplied the patch

Steven Brown’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev

Issue has been set to the 7.x dev branch because that's where the patch will be made against and applied to.

@nalan When this patch has been reviewed and committed then we will back port it to D6

stella’s picture

Priority: Critical » Normal
Status: Needs review » Fixed

That isn't the correct solution. The javascript is not meant to work on the "faq-qa" class as that would break other layouts. The problem is actually caused by the recent change to the page path (from "faq" to "faq-page"). I've fixed this issue and committed the change to the dev version in commit 0f3a24e

A longer term fix for the path change is being discussed at #1394284: Change faq-page path

Another ticket on the "jumping" issue is open at #1381974: Collapsed question jump up the page when there is a scroll

Status: Fixed » Closed (fixed)

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

anil_89’s picture

I have added path this is very easy to change just replace
div id div.faq-qa-hide to div.faq-qa but it hide all page content it should be hide only fag description

dadderley’s picture

Issue summary: View changes

I am still running into this issue in the newest dev version and and in 7.x-1.1.
When I change the path of the FAQ page to 'faq-page' it works.
So this is related to this issue, Fix Hardcoded FAQ Path 'faq-page', @ https://www.drupal.org/node/2623326

JudyPJHsu’s picture

Data point: I have aliased the faq-page path rather than changing from the module configuration options. The collapse all function is not available.