{"action":"created","issue":{"url":"https://api.github.com/repos/dereuromark/cakephp-queue/issues/25","labels_url":"https://api.github.com/repos/dereuromark/cakephp-queue/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/dereuromark/cakephp-queue/issues/25/comments","events_url":"https://api.github.com/repos/dereuromark/cakephp-queue/issues/25/events","html_url":"https://github.com/dereuromark/cakephp-queue/issues/25","id":58636343,"number":25,"title":"Can't use custom APP task with same name as one in Queue plugin","user":{"login":"houseoftech","id":297458,"avatar_url":"https://avatars.githubusercontent.com/u/297458?v=3","gravatar_id":"","url":"https://api.github.com/users/houseoftech","html_url":"https://github.com/houseoftech","followers_url":"https://api.github.com/users/houseoftech/followers","following_url":"https://api.github.com/users/houseoftech/following{/other_user}","gists_url":"https://api.github.com/users/houseoftech/gists{/gist_id}","starred_url":"https://api.github.com/users/houseoftech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houseoftech/subscriptions","organizations_url":"https://api.github.com/users/houseoftech/orgs","repos_url":"https://api.github.com/users/houseoftech/repos","events_url":"https://api.github.com/users/houseoftech/events{/privacy}","received_events_url":"https://api.github.com/users/houseoftech/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-23T19:36:22Z","updated_at":"2015-02-23T21:01:58Z","closed_at":null,"body":"I tried to copy the QueueEmailTask.php to my App so I could make my own custom email task, but it keeps running the plugin version.\r\n\r\nIn [QueueShell::initialize()](https://github.com/dereuromark/cakephp-queue/blob/master/Console/Command/QueueShell.php#L44-63) if you switch around the searching of the tasks such that APP tasks are loaded after plugins, then the app version would override the plugin version and it works.\r\n\r\nI'm not sure if this is a big enough deal for you to want to make the change. I just thought I'd point it out."},"comment":{"url":"https://api.github.com/repos/dereuromark/cakephp-queue/issues/comments/75630855","html_url":"https://github.com/dereuromark/cakephp-queue/issues/25#issuecomment-75630855","issue_url":"https://api.github.com/repos/dereuromark/cakephp-queue/issues/25","id":75630855,"user":{"login":"houseoftech","id":297458,"avatar_url":"https://avatars.githubusercontent.com/u/297458?v=3","gravatar_id":"","url":"https://api.github.com/users/houseoftech","html_url":"https://github.com/houseoftech","followers_url":"https://api.github.com/users/houseoftech/followers","following_url":"https://api.github.com/users/houseoftech/following{/other_user}","gists_url":"https://api.github.com/users/houseoftech/gists{/gist_id}","starred_url":"https://api.github.com/users/houseoftech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houseoftech/subscriptions","organizations_url":"https://api.github.com/users/houseoftech/orgs","repos_url":"https://api.github.com/users/houseoftech/repos","events_url":"https://api.github.com/users/houseoftech/events{/privacy}","received_events_url":"https://api.github.com/users/houseoftech/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T21:01:58Z","updated_at":"2015-02-23T21:01:58Z","body":"At line 44 you would change\r\n\r\n````\r\n\t\tforeach ($paths as $path) {\r\n\t\t\t$Folder = new Folder($path);\r\n\t\t\t$res = array_merge($this->tasks, $Folder->find('Queue.*\\.php'));\r\n\t\t\tforeach ($res as &$r) {\r\n\t\t\t\t$r = basename($r, 'Task.php');\r\n\t\t\t}\r\n\t\t\t$this->tasks = $res;\r\n\t\t}\r\n\t\t$plugins = CakePlugin::loaded();\r\n\t\tforeach ($plugins as $plugin) {\r\n\t\t\t$pluginPaths = App::path('Console/Command/Task', $plugin);\r\n\t\t\tforeach ($pluginPaths as $pluginPath) {\r\n\t\t\t\t$Folder = new Folder($pluginPath);\r\n\t\t\t\t$res = $Folder->find('Queue.*Task\\.php');\r\n\t\t\t\tforeach ($res as &$r) {\r\n\t\t\t\t\t$r = $plugin . '.' . basename($r, 'Task.php');\r\n\t\t\t\t}\r\n\t\t\t\t$this->tasks = array_merge($this->tasks, $res);\r\n\t\t\t}\r\n\t\t}\r\n````\r\nto\r\n````\r\n\t\t$plugins = CakePlugin::loaded();\r\n\t\tforeach ($plugins as $plugin) {\r\n\t\t\t$pluginPaths = App::path('Console/Command/Task', $plugin);\r\n\t\t\tforeach ($pluginPaths as $pluginPath) {\r\n\t\t\t\t$Folder = new Folder($pluginPath);\r\n\t\t\t\t$res = $Folder->find('Queue.*Task\\.php');\r\n\t\t\t\tforeach ($res as &$r) {\r\n\t\t\t\t\t$r = $plugin . '.' . basename($r, 'Task.php');\r\n\t\t\t\t}\r\n\t\t\t\t$this->tasks = array_merge($this->tasks, $res);\r\n\t\t\t}\r\n\t\t}\r\n\t\tforeach ($paths as $path) {\r\n\t\t\t$Folder = new Folder($path);\r\n\t\t\t$res = array_merge($this->tasks, $Folder->find('Queue.*\\.php'));\r\n\t\t\tforeach ($res as &$r) {\r\n\t\t\t\t$r = basename($r, 'Task.php');\r\n\t\t\t}\r\n\t\t\t$this->tasks = $res;\r\n\t\t}\r\n````"}}