mitKrish / concerto-platform

Automatically exported from code.google.com/p/concerto-platform
0 stars 0 forks source link

Test may stall because of php warning in Test::verified_input_values() #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
*What steps will reproduce the problem?*
1. create a test and add *no* further test input parameters
2. php will add a warning to the answer of the ajax call:
Warning: Invalid argument supplied for foreach() in 
/var/www/concerto/cms/model/Test.php on line 103
3. The test session is stalled waiting for data

*What is the expected output? What do you see instead?*
no php warning

*What version of the product are you using? On what operating system?*
concerto 4.0.0.beta7
R version 3.0.1 (2013-05-16) -- "Good Sport"
PHP 5.3.10-1ubuntu3.7 with Suhosin-Patch (cli) (built: Jul 15 2013 18:05:44)

*Possible Fix*

    public function verified_input_values($values) {
        $result = array();
        $params = $this->get_parameter_TestVariables();

        if($values=="{}") {
                return($result);
        } else {
        foreach ($values as $vk => $vv) {
            foreach ($params as $param) {
                if ($param->name == $vk) {
                    $result[$vk] = $vv;
                    break;
                }
            }
        }
        return $result;
        }
    }

Original issue reported on code.google.com by Sebastia...@gmail.com on 9 Sep 2013 at 3:39

GoogleCodeExporter commented 9 years ago
Thank you for that report. You are right. It's fixed in r1358.

Original comment by LisPrzem...@gmail.com on 10 Sep 2013 at 2:32