{"action":"created","issue":{"url":"https://api.github.com/repos/getk2/k2/issues/130","repository_url":"https://api.github.com/repos/getk2/k2","labels_url":"https://api.github.com/repos/getk2/k2/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/getk2/k2/issues/130/comments","events_url":"https://api.github.com/repos/getk2/k2/issues/130/events","html_url":"https://github.com/getk2/k2/issues/130","id":30360514,"number":130,"title":"FATAL ERROR - ADD FRONT-END ITEM","user":{"login":"moXion","id":6152805,"avatar_url":"https://avatars.githubusercontent.com/u/6152805?v=3","gravatar_id":"","url":"https://api.github.com/users/moXion","html_url":"https://github.com/moXion","followers_url":"https://api.github.com/users/moXion/followers","following_url":"https://api.github.com/users/moXion/following{/other_user}","gists_url":"https://api.github.com/users/moXion/gists{/gist_id}","starred_url":"https://api.github.com/users/moXion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moXion/subscriptions","organizations_url":"https://api.github.com/users/moXion/orgs","repos_url":"https://api.github.com/users/moXion/repos","events_url":"https://api.github.com/users/moXion/events{/privacy}","received_events_url":"https://api.github.com/users/moXion/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/getk2/k2/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2014-03-28T03:15:10Z","updated_at":"2016-08-10T20:18:06Z","closed_at":"2014-03-28T13:15:16Z","body":"I've just notice this situation today, due a report from a collaborator that have access to add items in front end. \r\nWhen trying 'Add Item' , the popup window give error: \r\n\r\nFatal error: Call to a member function isCheckedOut() on a non-object in /hsphere/local/home/c290983/theazores.pt/administrator/components/com_k2/views/item/view.html.php on line 100! \r\n\r\nEverything works fine in the administration, I can add/edit items with no problem. \r\n\r\nSystem: \r\n- Joomla 3.2.3 \r\n- K2 2.6.9 (Develper Build) - The problem starts with 2.6.8 version, I've just install de Developer Version to see if this fix this problem. \r\n\r\nAppreciate your help, this is URGENT. \r\n\r\nRegards and thank you, \r\n\r\nPedro "},"comment":{"url":"https://api.github.com/repos/getk2/k2/issues/comments/238990615","html_url":"https://github.com/getk2/k2/issues/130#issuecomment-238990615","issue_url":"https://api.github.com/repos/getk2/k2/issues/130","id":238990615,"user":{"login":"andergmartins","id":407131,"avatar_url":"https://avatars.githubusercontent.com/u/407131?v=3","gravatar_id":"","url":"https://api.github.com/users/andergmartins","html_url":"https://github.com/andergmartins","followers_url":"https://api.github.com/users/andergmartins/followers","following_url":"https://api.github.com/users/andergmartins/following{/other_user}","gists_url":"https://api.github.com/users/andergmartins/gists{/gist_id}","starred_url":"https://api.github.com/users/andergmartins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andergmartins/subscriptions","organizations_url":"https://api.github.com/users/andergmartins/orgs","repos_url":"https://api.github.com/users/andergmartins/repos","events_url":"https://api.github.com/users/andergmartins/events{/privacy}","received_events_url":"https://api.github.com/users/andergmartins/received_events","type":"User","site_admin":false},"created_at":"2016-08-10T20:18:06Z","updated_at":"2016-08-10T20:18:06Z","body":"I was able to reproduce this issue on a client site today. \r\n\r\nAfter debugging I found out that when you call the task item.add, it will load the view K2ViewItem from the admin. That is ok, but inside the view it is loading the wrong model class. \r\n\r\nYou can check that on this line:\r\nhttps://github.com/andergmartins/k2/blob/master/administrator/components/com_k2/views/item/view.html.php#L44 we get the instance of the module, specifying the class prefix: K2Model. That is correct. But on the line https://github.com/andergmartins/k2/blob/master/administrator/components/com_k2/views/item/view.html.php#L43 we don't add the path to the correct prefix, since there is no prefix.\r\nAccording to my tests, if you omit the prefix, the line 44 will result in an instance of the frontend module (which path is already there, since we are on the frontend) instead of the model from the backend. It is clear that we are expecting a model from the backend because we are calling methods like isCheckedOut which is only available on the class provide by the backend. \r\n\r\n"}}
{"actor":{"display_login":"andergmartins"}}