From: Søren V. <sv...@sq...> - 2014-10-21 12:22:17
|
Thanks to Alex Mountjoy for providing an update to v. 2.1.4 that complies with newer php installations. I must admit that I was on 2.1.2, so I don't know if my problems with the latest version is related to new functionality included already in 2.1.3 or 2.1.4. To boil down my problem I have reproduced this on a fresh plain-vanilla 2.1.4_master installation - only modified the phpESP.ini.php with appropriate values. I have deleted all database tables from the earlier version, and started from a fresh database intitiated by phpESP itself. I have made a simple TEST-survey with two identically formatted sections separated by a section break. Each of the two sections have three questions. First there are two radio button MUST questions each with five options, and then there is one open text field for comments. I do not use credit or feedback. When I enter the survey, it displays correctly and I can fill in the first page. When I press "next page", I am shown the second page. If I have filled in the open text response I will see on the top of page two the notices: Notice: Undefined offset: 3 in /var/www/vhosts/fbumonacom/www/phpESP/public/handler.php on line 386 Notice: Undefined offset: 4 in /var/www/vhosts/fbumonacom/www/phpESP/public/handler.php on line 386 and that can be filled in as well. Using phpmyadmin I can verify that phpESP actually updates the response_single table correctly with the answers I gave on page one. I can then fill in page two with replies. Now if I go back pressing "previous page" I am shown the first page again but the radio button content I gave is *NOT* displayed, i.e. the two questions appear to be unanswered. The open text response is OK though. If I retype the answers to the radio button questions and press "Next page" the same Notices as above will appear, and again the radio button questions are seemingly unanswered although I did fill them in earlier. If I complete page 2 without going back to page 1 but rather "Save Survey" I can verify that the given replies are actually in the database (response_single). (I will receive the Notices mentioned above on top of my thank-you-page, if I have given an open text answer on page two. If I have not given an open text answer on a given page the notices will not be given). I have struggled with this for quite some time, and I sense that the problem is related to credit and feedback columns, and I have found a very crude work-around which returns normal behavior in my example. line 505 in espresponse.inc: FROM: $sql = "SELECT q.id $col,c.content,c.id,c.feedback,c.credit TO: $sql = "SELECT q.id $col,c.content,c.id i.e. delete the SELECT of columns c.feedback and c.credit This will make the radio button response appear correctly as you browse forward/backward between sections. In turn you will get a lot of notices which must be suppressed by setting the error-level: ------- Notice: Undefined offset: -1 in /var/www/vhosts/fbumonacom/www/phpESP/admin/include/lib/espresponse.inc on line 514 Notice: Undefined offset: -1 in /var/www/vhosts/fbumonacom/www/phpESP/admin/include/lib/espresponse.inc on line 514 Notice: Undefined offset: 3 in /var/www/vhosts/fbumonacom/www/phpESP/public/handler.php on line 386 Notice: Undefined offset: 4 in /var/www/vhosts/fbumonacom/www/phpESP/public/handler.php on line 386 Notice: Undefined offset: 3 in /var/www/vhosts/fbumonacom/www/phpESP/public/handler.php on line 386 Notice: Undefined offset: 4 in /var/www/vhosts/fbumonacom/www/phpESP/public/handler.php on line 386 Notice: Undefined offset: 3 in /var/www/vhosts/fbumonacom/www/phpESP/public/handler.php on line 386 Notice: Undefined offset: 4 in /var/www/vhosts/fbumonacom/www/phpESP/public/handler.php on line 386 ------- Any thoughts on this would really be appreciated. Thanks Søren Voigt |