{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/10756","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/10756/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/10756/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/10756/events","html_url":"https://github.com/joomla/joomla-cms/pull/10756","id":159129604,"number":10756,"title":"[com_menus] improve alias check and generation","user":{"login":"andrepereiradasilva","id":9630530,"avatar_url":"https://avatars.githubusercontent.com/u/9630530?v=3","gravatar_id":"","url":"https://api.github.com/users/andrepereiradasilva","html_url":"https://github.com/andrepereiradasilva","followers_url":"https://api.github.com/users/andrepereiradasilva/followers","following_url":"https://api.github.com/users/andrepereiradasilva/following{/other_user}","gists_url":"https://api.github.com/users/andrepereiradasilva/gists{/gist_id}","starred_url":"https://api.github.com/users/andrepereiradasilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrepereiradasilva/subscriptions","organizations_url":"https://api.github.com/users/andrepereiradasilva/orgs","repos_url":"https://api.github.com/users/andrepereiradasilva/repos","events_url":"https://api.github.com/users/andrepereiradasilva/events{/privacy}","received_events_url":"https://api.github.com/users/andrepereiradasilva/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-08T10:22:50Z","updated_at":"2016-06-08T11:22:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/10756","html_url":"https://github.com/joomla/joomla-cms/pull/10756","diff_url":"https://github.com/joomla/joomla-cms/pull/10756.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/10756.patch"},"body":"#### Summary of Changes\r\n\r\nThis PR makes several changes on the menu alias generate process.\r\n- Improves alias generation\r\n- Improves alias conflict detection\r\n\r\nAlso solves some issues in the current alias generate process:\r\n\r\n1. In a monolingual site (language filter plugin disabled), create a menu item with the same alias as other menu item you have in the same/other menu root but with different language.\r\n\r\n You'll notice it will save with success but it shouldn't.\r\n\r\n2. In a multilingual site (language filter plugin enabled), create a menu item with the same alias as other menu item with All language you have in the same/other menu root but in a different language.\r\n\r\n You'll notice it will save with success but it shouldn't.\r\n\r\n3. Create a menu item of System Links -> *Any type*\r\n\r\n You'll notice the generate alias is the current date, not menu item title.\r\n\r\n#### Testing Instructions\r\n\r\nThis needs to be tested with the proper attention.\r\n\r\n- Use latest staging and apply patch\r\n- Install one adicional language (example: fr-FR)\r\n- Create the following menu structure:\r\n```\r\n Menu Type 1:\r\n - Menu item A: Language All, Alias: menu-item-a\r\n - Menu item B: Language en-GB, Alias: menu-item-b\r\n - Menu item C: Language fr-FR, Alias: menu-item-c\r\n Menu Type 2:\r\n - Menu item D: Language All, Alias: menu-item-d\r\n - Menu item E: Language en-GB, Alias: menu-item-e\r\n - Menu item F: Language fr-FR, Alias: menu-item-f\r\n```\r\n- Apply patch\r\n- Set the site to monolingual (Disable Language Filter System plugin)\r\n- Change the alias in `Menu item B` to `menu-item-a`. It should give a error message.\r\n- Change the alias in `Menu item F` to `menu-item-a`. It should give a error message.\r\n- Now set the site to multilingual (Enable Language Filter System plugin)\r\n- Change the alias in `Menu item B` to `menu-item-a`. It should give a error message.\r\n- Change the alias in `Menu item F` to `menu-item-e`. It should save fine.\r\n- Change the alias in `Menu item E` to `menu-item-a`. It should give a error message.\r\n- Now create a menu item of System Type -> Menu alias and let it auto generate the alias. It should generate fine (without the date as alias).\r\n- Play a little with the alias and check everything is fine (test with and without unicode in global config).\r\n\r\nFinally do a code review of the changes.\r\n\r\n#### Observations\r\n\r\nThe alias cannot be duplicated in the following cases:\r\n\r\n###### Monolingual Site (language filter plugin disabled)\r\n\r\n1. The menu item is at root level and has the same alias of other menu item that is at root level of any other menu.\r\n2. The menu item is not at root level, but was the has the same alias of other menu item that has the  same parent.\r\n\r\n###### Multilingual Site (language filter plugin enabled)\r\n\r\n1. The menu item language is \"All\", is at root level and has the same alias of other menu item (any language) that is at root level of any other menu.\r\n2. The menu item language is NOT \"All\", is at root level and has the same alias of other menu item (same or \"All\" language) that is at root level of any other menu.\r\n3. The menu item language is \"All\", is not at root level, but was the has the same alias of other menu item (any language) that has the  same parent.\r\n4. The menu item language is \"All\", is not at root level, but was the has the same alias of other menu item (same or \"All\" language) that has the  same parent.\r\n\r\n@infograf768 please check if all is working fine."},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/224560978","html_url":"https://github.com/joomla/joomla-cms/pull/10756#issuecomment-224560978","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/10756","id":224560978,"user":{"login":"infograf768","id":869724,"avatar_url":"https://avatars.githubusercontent.com/u/869724?v=3","gravatar_id":"","url":"https://api.github.com/users/infograf768","html_url":"https://github.com/infograf768","followers_url":"https://api.github.com/users/infograf768/followers","following_url":"https://api.github.com/users/infograf768/following{/other_user}","gists_url":"https://api.github.com/users/infograf768/gists{/gist_id}","starred_url":"https://api.github.com/users/infograf768/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infograf768/subscriptions","organizations_url":"https://api.github.com/users/infograf768/orgs","repos_url":"https://api.github.com/users/infograf768/repos","events_url":"https://api.github.com/users/infograf768/events{/privacy}","received_events_url":"https://api.github.com/users/infograf768/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T11:22:15Z","updated_at":"2016-06-08T11:22:15Z","body":"Pleas set the  $this->type= 'url' to empty to get a date as the alias is no use for an url and it will avoid an error if the alias is used for another menu item with same parent. THis was the reason it was implemented such originally."}}
{"actor":{"display_login":"infograf768"}}