{"action":"closed","issue":{"url":"https://api.github.com/repos/zikula/core/issues/3124","repository_url":"https://api.github.com/repos/zikula/core","labels_url":"https://api.github.com/repos/zikula/core/issues/3124/labels{/name}","comments_url":"https://api.github.com/repos/zikula/core/issues/3124/comments","events_url":"https://api.github.com/repos/zikula/core/issues/3124/events","html_url":"https://github.com/zikula/core/issues/3124","id":185099653,"number":3124,"title":"Error when edit category in case of more then one language is installed","user":{"login":"nmpetkov","id":628801,"avatar_url":"https://avatars.githubusercontent.com/u/628801?v=3","gravatar_id":"","url":"https://api.github.com/users/nmpetkov","html_url":"https://github.com/nmpetkov","followers_url":"https://api.github.com/users/nmpetkov/followers","following_url":"https://api.github.com/users/nmpetkov/following{/other_user}","gists_url":"https://api.github.com/users/nmpetkov/gists{/gist_id}","starred_url":"https://api.github.com/users/nmpetkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmpetkov/subscriptions","organizations_url":"https://api.github.com/users/nmpetkov/orgs","repos_url":"https://api.github.com/users/nmpetkov/repos","events_url":"https://api.github.com/users/nmpetkov/events{/privacy}","received_events_url":"https://api.github.com/users/nmpetkov/received_events","type":"User","site_admin":false},"labels":[{"id":129124,"url":"https://api.github.com/repos/zikula/core/labels/Bug","name":"Bug","color":"e102d8","default":false},{"id":129366266,"url":"https://api.github.com/repos/zikula/core/labels/Feedback%20required","name":"Feedback required","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":{"login":"Guite","id":277531,"avatar_url":"https://avatars.githubusercontent.com/u/277531?v=3","gravatar_id":"","url":"https://api.github.com/users/Guite","html_url":"https://github.com/Guite","followers_url":"https://api.github.com/users/Guite/followers","following_url":"https://api.github.com/users/Guite/following{/other_user}","gists_url":"https://api.github.com/users/Guite/gists{/gist_id}","starred_url":"https://api.github.com/users/Guite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Guite/subscriptions","organizations_url":"https://api.github.com/users/Guite/orgs","repos_url":"https://api.github.com/users/Guite/repos","events_url":"https://api.github.com/users/Guite/events{/privacy}","received_events_url":"https://api.github.com/users/Guite/received_events","type":"User","site_admin":false},"assignees":[{"login":"Guite","id":277531,"avatar_url":"https://avatars.githubusercontent.com/u/277531?v=3","gravatar_id":"","url":"https://api.github.com/users/Guite","html_url":"https://github.com/Guite","followers_url":"https://api.github.com/users/Guite/followers","following_url":"https://api.github.com/users/Guite/following{/other_user}","gists_url":"https://api.github.com/users/Guite/gists{/gist_id}","starred_url":"https://api.github.com/users/Guite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Guite/subscriptions","organizations_url":"https://api.github.com/users/Guite/orgs","repos_url":"https://api.github.com/users/Guite/repos","events_url":"https://api.github.com/users/Guite/events{/privacy}","received_events_url":"https://api.github.com/users/Guite/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/zikula/core/milestones/21","html_url":"https://github.com/zikula/core/milestones/1.4.4","labels_url":"https://api.github.com/repos/zikula/core/milestones/21/labels","id":1876349,"number":21,"title":"1.4.4","description":"Fourth service release for 1.4.x series","creator":{"login":"craigh","id":350048,"avatar_url":"https://avatars.githubusercontent.com/u/350048?v=3","gravatar_id":"","url":"https://api.github.com/users/craigh","html_url":"https://github.com/craigh","followers_url":"https://api.github.com/users/craigh/followers","following_url":"https://api.github.com/users/craigh/following{/other_user}","gists_url":"https://api.github.com/users/craigh/gists{/gist_id}","starred_url":"https://api.github.com/users/craigh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigh/subscriptions","organizations_url":"https://api.github.com/users/craigh/orgs","repos_url":"https://api.github.com/users/craigh/repos","events_url":"https://api.github.com/users/craigh/events{/privacy}","received_events_url":"https://api.github.com/users/craigh/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":79,"state":"open","created_at":"2016-07-11T16:39:55Z","updated_at":"2016-11-11T08:49:17Z","due_on":"2016-11-25T00:00:00Z","closed_at":null},"comments":7,"created_at":"2016-10-25T12:16:24Z","updated_at":"2016-11-11T08:49:17Z","closed_at":"2016-11-11T08:49:17Z","body":"| Q | A |\n| --- | --- |\n| Zikula Version | 1.4.3 |\n| PHP Version | 5.6.24 |\n### Expected behaviour\n\nNo error when edit category in case of more then one language is installed\n### Actual behaviour\n\nObtain an error when trying to edit a category in case of more then one language is installed.\n### Steps to reproduce\n\nInstall Zikula 1.4.3, then install one more language.\nGo to Administration, Categories, and expand the list. Try to edit a category.\nError:\n`Key \"bg\" for array with keys \"en\" does not exist in system/CategoriesModule/Resources/views/Admin/edit.html.twig at line 68`\n### Comment:\n\nOne possible solution is to check if display_name is set for each language in function getCategoryByID in file lib/util/CategoryUtil.php. Find line\n`$cat = $category->toArray();`\nand insert after:\n\n```\n        // set display_name by languages if not set\n        $languages = ZLanguage::getInstalledLanguages();\n        foreach ($languages as $lang) {\n            if (!isset($cat['display_name'][$lang])) {\n                $cat['display_name'][$lang] = isset($cat['display_name']['en']) ? $cat['display_name']['en'] : '';\n            }\n            if (!isset($cat['display_desc'][$lang])) {\n                $cat['display_desc'][$lang] = isset($cat['display_desc']['en']) ? $cat['display_desc']['en'] : '';\n            }\n        }\n```\n\nAlso in function getCategories.\n"}}
{"actor":{"display_login":"Guite"}}