{"action":"opened","number":26,"pull_request":{"url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/pulls/26","id":39474822,"html_url":"https://github.com/jleyva/moodle-local_ltiprovider/pull/26","diff_url":"https://github.com/jleyva/moodle-local_ltiprovider/pull/26.diff","patch_url":"https://github.com/jleyva/moodle-local_ltiprovider/pull/26.patch","issue_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/issues/26","number":26,"state":"open","locked":false,"title":"local_ltiprovider_add_tool and _update_tool isset bug","user":{"login":"Trii","id":638073,"avatar_url":"https://avatars.githubusercontent.com/u/638073?v=3","gravatar_id":"","url":"https://api.github.com/users/Trii","html_url":"https://github.com/Trii","followers_url":"https://api.github.com/users/Trii/followers","following_url":"https://api.github.com/users/Trii/following{/other_user}","gists_url":"https://api.github.com/users/Trii/gists{/gist_id}","starred_url":"https://api.github.com/users/Trii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trii/subscriptions","organizations_url":"https://api.github.com/users/Trii/orgs","repos_url":"https://api.github.com/users/Trii/repos","events_url":"https://api.github.com/users/Trii/events{/privacy}","received_events_url":"https://api.github.com/users/Trii/received_events","type":"User","site_admin":false},"body":"Some fields in the local_ltiprovider record are set to 1 even if you pass a 0\r\ninto the add/update function. This was because of a ternary operation around\r\nisset(0) == false.\r\n\r\nisset() and empty() return true for falsey values including 0.\r\n\r\n```sh\r\n$ php -r '$x = 0; var_dump(isset($x) ? 1 : 0);'\r\nint(1)\r\n\r\n$ php -r '$x = 0; var_dump(empty($x) ? 1 : 0);'\r\nint(1)\r\n```\r\n\r\nFixes #19","created_at":"2015-07-08T13:09:39Z","updated_at":"2015-07-08T13:09:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"92deec2ae23b021c0955ace8c6c21ae3e2dc6006","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/pulls/26/commits","review_comments_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/pulls/26/comments","review_comment_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/issues/26/comments","statuses_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/statuses/989189227b26a508c2c35ed25bb98bd5c77e1e4c","head":{"label":"Trii:issue-19","ref":"issue-19","sha":"989189227b26a508c2c35ed25bb98bd5c77e1e4c","user":{"login":"Trii","id":638073,"avatar_url":"https://avatars.githubusercontent.com/u/638073?v=3","gravatar_id":"","url":"https://api.github.com/users/Trii","html_url":"https://github.com/Trii","followers_url":"https://api.github.com/users/Trii/followers","following_url":"https://api.github.com/users/Trii/following{/other_user}","gists_url":"https://api.github.com/users/Trii/gists{/gist_id}","starred_url":"https://api.github.com/users/Trii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trii/subscriptions","organizations_url":"https://api.github.com/users/Trii/orgs","repos_url":"https://api.github.com/users/Trii/repos","events_url":"https://api.github.com/users/Trii/events{/privacy}","received_events_url":"https://api.github.com/users/Trii/received_events","type":"User","site_admin":false},"repo":{"id":33619037,"name":"moodle-local_ltiprovider","full_name":"Trii/moodle-local_ltiprovider","owner":{"login":"Trii","id":638073,"avatar_url":"https://avatars.githubusercontent.com/u/638073?v=3","gravatar_id":"","url":"https://api.github.com/users/Trii","html_url":"https://github.com/Trii","followers_url":"https://api.github.com/users/Trii/followers","following_url":"https://api.github.com/users/Trii/following{/other_user}","gists_url":"https://api.github.com/users/Trii/gists{/gist_id}","starred_url":"https://api.github.com/users/Trii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trii/subscriptions","organizations_url":"https://api.github.com/users/Trii/orgs","repos_url":"https://api.github.com/users/Trii/repos","events_url":"https://api.github.com/users/Trii/events{/privacy}","received_events_url":"https://api.github.com/users/Trii/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Trii/moodle-local_ltiprovider","description":"This is a local plugin for making Moodle a LTI provider tool","fork":true,"url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider","forks_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/forks","keys_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/teams","hooks_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/hooks","issue_events_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/issues/events{/number}","events_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/events","assignees_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/assignees{/user}","branches_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/branches{/branch}","tags_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/tags","blobs_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/git/refs{/sha}","trees_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/statuses/{sha}","languages_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/languages","stargazers_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/stargazers","contributors_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/contributors","subscribers_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/subscribers","subscription_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/subscription","commits_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/commits{/sha}","git_commits_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/git/commits{/sha}","comments_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/comments{/number}","issue_comment_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/issues/comments{/number}","contents_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/contents/{+path}","compare_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/merges","archive_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/downloads","issues_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/issues{/number}","pulls_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/pulls{/number}","milestones_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/milestones{/number}","notifications_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/labels{/name}","releases_url":"https://api.github.com/repos/Trii/moodle-local_ltiprovider/releases{/id}","created_at":"2015-04-08T16:37:22Z","updated_at":"2015-04-08T16:44:35Z","pushed_at":"2015-07-08T13:09:19Z","git_url":"git://github.com/Trii/moodle-local_ltiprovider.git","ssh_url":"git@github.com:Trii/moodle-local_ltiprovider.git","clone_url":"https://github.com/Trii/moodle-local_ltiprovider.git","svn_url":"https://github.com/Trii/moodle-local_ltiprovider","homepage":"","size":347,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jleyva:master","ref":"master","sha":"6ea3e9bba3f43dd2b3ed1876f761c90867ccf8df","user":{"login":"jleyva","id":615556,"avatar_url":"https://avatars.githubusercontent.com/u/615556?v=3","gravatar_id":"","url":"https://api.github.com/users/jleyva","html_url":"https://github.com/jleyva","followers_url":"https://api.github.com/users/jleyva/followers","following_url":"https://api.github.com/users/jleyva/following{/other_user}","gists_url":"https://api.github.com/users/jleyva/gists{/gist_id}","starred_url":"https://api.github.com/users/jleyva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleyva/subscriptions","organizations_url":"https://api.github.com/users/jleyva/orgs","repos_url":"https://api.github.com/users/jleyva/repos","events_url":"https://api.github.com/users/jleyva/events{/privacy}","received_events_url":"https://api.github.com/users/jleyva/received_events","type":"User","site_admin":false},"repo":{"id":3029683,"name":"moodle-local_ltiprovider","full_name":"jleyva/moodle-local_ltiprovider","owner":{"login":"jleyva","id":615556,"avatar_url":"https://avatars.githubusercontent.com/u/615556?v=3","gravatar_id":"","url":"https://api.github.com/users/jleyva","html_url":"https://github.com/jleyva","followers_url":"https://api.github.com/users/jleyva/followers","following_url":"https://api.github.com/users/jleyva/following{/other_user}","gists_url":"https://api.github.com/users/jleyva/gists{/gist_id}","starred_url":"https://api.github.com/users/jleyva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleyva/subscriptions","organizations_url":"https://api.github.com/users/jleyva/orgs","repos_url":"https://api.github.com/users/jleyva/repos","events_url":"https://api.github.com/users/jleyva/events{/privacy}","received_events_url":"https://api.github.com/users/jleyva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jleyva/moodle-local_ltiprovider","description":"This is a local plugin for making Moodle a LTI provider tool","fork":false,"url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider","forks_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/forks","keys_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/teams","hooks_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/hooks","issue_events_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/issues/events{/number}","events_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/events","assignees_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/assignees{/user}","branches_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/branches{/branch}","tags_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/tags","blobs_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/git/refs{/sha}","trees_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/statuses/{sha}","languages_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/languages","stargazers_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/stargazers","contributors_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/contributors","subscribers_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/subscribers","subscription_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/subscription","commits_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/commits{/sha}","git_commits_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/git/commits{/sha}","comments_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/comments{/number}","issue_comment_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/issues/comments{/number}","contents_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/contents/{+path}","compare_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/merges","archive_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/downloads","issues_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/issues{/number}","pulls_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/pulls{/number}","milestones_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/milestones{/number}","notifications_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/labels{/name}","releases_url":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/releases{/id}","created_at":"2011-12-21T20:52:11Z","updated_at":"2015-06-05T22:10:55Z","pushed_at":"2015-07-08T13:09:40Z","git_url":"git://github.com/jleyva/moodle-local_ltiprovider.git","ssh_url":"git@github.com:jleyva/moodle-local_ltiprovider.git","clone_url":"https://github.com/jleyva/moodle-local_ltiprovider.git","svn_url":"https://github.com/jleyva/moodle-local_ltiprovider","homepage":"","size":753,"stargazers_count":21,"watchers_count":21,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":10,"forks":21,"open_issues":10,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/pulls/26"},"html":{"href":"https://github.com/jleyva/moodle-local_ltiprovider/pull/26"},"issue":{"href":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/issues/26"},"comments":{"href":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/jleyva/moodle-local_ltiprovider/statuses/989189227b26a508c2c35ed25bb98bd5c77e1e4c"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":43,"deletions":15,"changed_files":1}}