{"action":"closed","issue":{"url":"https://api.github.com/repos/academic-moodle-cooperation/moodle-mod_publication/issues/2","labels_url":"https://api.github.com/repos/academic-moodle-cooperation/moodle-mod_publication/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/academic-moodle-cooperation/moodle-mod_publication/issues/2/comments","events_url":"https://api.github.com/repos/academic-moodle-cooperation/moodle-mod_publication/issues/2/events","html_url":"https://github.com/academic-moodle-cooperation/moodle-mod_publication/issues/2","id":68760100,"number":2,"title":"SQL error on PostgreSQL","user":{"login":"mudrd8mz","id":85831,"avatar_url":"https://avatars.githubusercontent.com/u/85831?v=3","gravatar_id":"","url":"https://api.github.com/users/mudrd8mz","html_url":"https://github.com/mudrd8mz","followers_url":"https://api.github.com/users/mudrd8mz/followers","following_url":"https://api.github.com/users/mudrd8mz/following{/other_user}","gists_url":"https://api.github.com/users/mudrd8mz/gists{/gist_id}","starred_url":"https://api.github.com/users/mudrd8mz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mudrd8mz/subscriptions","organizations_url":"https://api.github.com/users/mudrd8mz/orgs","repos_url":"https://api.github.com/users/mudrd8mz/repos","events_url":"https://api.github.com/users/mudrd8mz/events{/privacy}","received_events_url":"https://api.github.com/users/mudrd8mz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-15T18:47:18Z","updated_at":"2015-09-09T09:40:15Z","closed_at":"2015-09-09T09:40:15Z","body":"mod_form.php, around line 76. It currently reads\r\n\r\n     if(isset($this->current->id)){\r\n\r\nwhich seems to evaluate to true when the activity is being added. On PostgreSQL this leads to SQL error (comparing integer field with empty string, which MySQL tolerates).\r\nThe solution that works for me is to replace the line with\r\n\r\n    $filecount = 0;\r\n    if(!empty($this->current->id)){"}}