{"action":"created","issue":{"url":"https://api.github.com/repos/kordan/moodle-mod_surveypro/issues/3","labels_url":"https://api.github.com/repos/kordan/moodle-mod_surveypro/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/kordan/moodle-mod_surveypro/issues/3/comments","events_url":"https://api.github.com/repos/kordan/moodle-mod_surveypro/issues/3/events","html_url":"https://github.com/kordan/moodle-mod_surveypro/pull/3","id":83273995,"number":3,"title":"Fixing invalid query missing option from the group by","user":{"login":"donkeyx","id":132504,"avatar_url":"https://avatars.githubusercontent.com/u/132504?v=3","gravatar_id":"","url":"https://api.github.com/users/donkeyx","html_url":"https://github.com/donkeyx","followers_url":"https://api.github.com/users/donkeyx/followers","following_url":"https://api.github.com/users/donkeyx/following{/other_user}","gists_url":"https://api.github.com/users/donkeyx/gists{/gist_id}","starred_url":"https://api.github.com/users/donkeyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donkeyx/subscriptions","organizations_url":"https://api.github.com/users/donkeyx/orgs","repos_url":"https://api.github.com/users/donkeyx/repos","events_url":"https://api.github.com/users/donkeyx/events{/privacy}","received_events_url":"https://api.github.com/users/donkeyx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-06-01T02:33:30Z","updated_at":"2015-06-03T11:57:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kordan/moodle-mod_surveypro/pulls/3","html_url":"https://github.com/kordan/moodle-mod_surveypro/pull/3","diff_url":"https://github.com/kordan/moodle-mod_surveypro/pull/3.diff","patch_url":"https://github.com/kordan/moodle-mod_surveypro/pull/3.patch"},"body":"Hey guys, \r\n\r\nNot sure of the workflow but I have found an invalid query missing one of the options in the group by. I have just committed to the 27 branch but it is also invalid on master? Happy for feedback? Also, not 100% sure what the intention was for that query so might need checking. \r\n\r\nCheers Dave."},"comment":{"url":"https://api.github.com/repos/kordan/moodle-mod_surveypro/issues/comments/108338706","html_url":"https://github.com/kordan/moodle-mod_surveypro/pull/3#issuecomment-108338706","issue_url":"https://api.github.com/repos/kordan/moodle-mod_surveypro/issues/3","id":108338706,"user":{"login":"kordan","id":554353,"avatar_url":"https://avatars.githubusercontent.com/u/554353?v=3","gravatar_id":"","url":"https://api.github.com/users/kordan","html_url":"https://github.com/kordan","followers_url":"https://api.github.com/users/kordan/followers","following_url":"https://api.github.com/users/kordan/following{/other_user}","gists_url":"https://api.github.com/users/kordan/gists{/gist_id}","starred_url":"https://api.github.com/users/kordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kordan/subscriptions","organizations_url":"https://api.github.com/users/kordan/orgs","repos_url":"https://api.github.com/users/kordan/repos","events_url":"https://api.github.com/users/kordan/events{/privacy}","received_events_url":"https://api.github.com/users/kordan/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T11:57:36Z","updated_at":"2015-06-03T11:57:36Z","body":"yes Dave,\r\nI remember the story now.\r\n\r\nLet's say you have a surveypro with 10 pages.\r\nYou are filling page 4 and you have a doubt about what you entered in page 3.\r\nSo you press the \"Previous\" button.\r\nWhat I suppose is that you want to see page 3 without any boring and useless question\r\nbut maybe in page 4 there is a mandatory field that forces you to fill it before redirecting you back to page 3.\r\n\r\nThis is an undesired behaviour that can not be allowed!\r\nTo let you return to page 3 without any question, the code has to jump the form validation but this means it can not be allowed to save the form.\r\n\r\nThe same is true if the user pushes the \"pause\" button. User has to go. He/she no longer care the surveypro. He/she want to go and doesn't want any boring and useless question...\r\n\r\nThis is why I have\r\nif (!$prevbutton && !$pausebutton) {\r\nabout line 120 of view_userform.php\r\n\r\n---\r\n\r\nSecond modification: about line 690 of view_userform.class.php the management of \"pause\" and \"prev\" buttons is useless.\r\nThis is the comment I added just by the code:\r\n\r\n// submit buttons are 3 and only 3 (And not 5 as it may appear!)\r\n// if empty($this->formdata->submissionid) this means that:\r\n// 1) you pressed the \"save as new\" button\r\n// 2) the submission is unknown to the db\r\n//\r\n// case 1) for sure the \"pause\" button or \"prev\" button were not pressed, so they don't need any management\r\n// case 2) the form is in its first page so:\r\n//         a) \"prev\" button does not exist\r\n//         b) the \"pause\" button, even whether pressed, does not lead to save because...\r\n//            (if the user presses \"pause\" this means he/she want to leave\r\n//            and he/she doesn't want any break of balls with undesired questions)\r\n//            Because of this, if \"pause\" was requested I am not here infact\r\n//            in view_userform.php the save_user_data() method is jumped\r\n//\r\n// so, the overall behaviour is: do not manage these two buttons. This management is useless.\r\n// if ($nextbutton || $pausebutton || $prevbutton) {\r\n\r\nTel me if you can imagine any better solution!"}}