#1 Page hangs unde certain dependency conditions (bug fix)

v1.04
closed-fixed
nobody
7
2004-05-23
2004-05-20
John Holmes
No

This bug will cause the page to hang as the script tries
to look for the questions for the next page under certain
conditions.

The problem is when you have the last question on a
page have a dependency to be hidden yet there is also
a question that's required on that page. because of the
error in the code, the script will think the page is empty
(because last question was hidden) and try to move to
the next page. Because there was a required question
on the page, though, the page number will not increment
and the same process will begin, resulting in an infinite
loop. The script times out and fails.

Discussion

  • John Holmes
    John Holmes
    2004-05-20

    Logged In: YES
    user_id=609197

    The solution is an easy fix. Line 1038 of survey.class.php for
    v1.04 is

    if(empty($q))

    when it should be

    if($empty($question_text))

    which cause the script to check if the _entire page_ is empty
    (and thus trigger a reload to get the next page) instead of
    just the last question.

     
  • John Holmes
    John Holmes
    2004-05-20

    • status: open --> open-fixed
     
  • John Holmes
    John Holmes
    2004-05-20

    • status: open-fixed --> closed-fixed
     
  • John Holmes
    John Holmes
    2004-05-23

    • summary: Page fails to load when certain dependency condition are met --> Page hangs unde certain dependency conditions (bug fix)
     
  • John Holmes
    John Holmes
    2004-05-24

    Logged In: YES
    user_id=609197

    Sorry, that should be

    if(empty($question_text))

    for the fix. No '$' before 'empty'