{"action":"closed","issue":{"url":"https://api.github.com/repos/osclass/Osclass/issues/2131","repository_url":"https://api.github.com/repos/osclass/Osclass","labels_url":"https://api.github.com/repos/osclass/Osclass/issues/2131/labels{/name}","comments_url":"https://api.github.com/repos/osclass/Osclass/issues/2131/comments","events_url":"https://api.github.com/repos/osclass/Osclass/issues/2131/events","html_url":"https://github.com/osclass/Osclass/issues/2131","id":210831272,"number":2131,"title":"Alert is not working if the subscribed user is not registered.","user":{"login":"dev-subhojit","id":26091748,"avatar_url":"https://avatars3.githubusercontent.com/u/26091748?v=3","gravatar_id":"","url":"https://api.github.com/users/dev-subhojit","html_url":"https://github.com/dev-subhojit","followers_url":"https://api.github.com/users/dev-subhojit/followers","following_url":"https://api.github.com/users/dev-subhojit/following{/other_user}","gists_url":"https://api.github.com/users/dev-subhojit/gists{/gist_id}","starred_url":"https://api.github.com/users/dev-subhojit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dev-subhojit/subscriptions","organizations_url":"https://api.github.com/users/dev-subhojit/orgs","repos_url":"https://api.github.com/users/dev-subhojit/repos","events_url":"https://api.github.com/users/dev-subhojit/events{/privacy}","received_events_url":"https://api.github.com/users/dev-subhojit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-02-28T16:07:01Z","updated_at":"2017-03-30T13:26:50Z","closed_at":"2017-03-30T13:26:50Z","body":"I tested the alert system, on the file Alerts.php look there is a code(file: oc-includes/osclass/model/Alerts.php 184 No Line)  `$this->dao->where('fk_i_user_id', $user);` this should be look like this: `$this->dao->where('pk_i_id', $user);` because if the user not been registered on the site the foreign key of the alerts table(column fk_i_user_id) is marking as zero. In this case no email should be send while cron is running. And also I am sure this code (file: oc-includes/osclass/alerts.php 77 No Line) `$alert = Alerts::newInstance()->findBySearchAndUser($s_search['s_search'], $user['pk_i_id']);` is collecting the primary key from the table alerts please check this code(file: oc-includes/osclass/alerts.php 68 No Line): `$users = Alerts::newInstance()->findUsersBySearchAndType($s_search['s_search'], $type, $active);`\r\n\r\nAfter fixing this issue I am receiving the alerts. Please check and resolve the issue. Thanks"}}
{"actor":{"display_login":"conejoninja"}}