{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/10249","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/10249/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/10249/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/10249/events","html_url":"https://github.com/joomla/joomla-cms/pull/10249","id":153185892,"number":10249,"title":"Multilanguage (but not only): Adding field menuitem to login menu item","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},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/Language%20Change","name":"Language Change","color":"eb6420"},{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/New%20Feature","name":"New Feature","color":"e102d8"},{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/joomla/joomla-cms/milestones/12","html_url":"https://github.com/joomla/joomla-cms/milestones/Joomla%203.6.0","labels_url":"https://api.github.com/repos/joomla/joomla-cms/milestones/12/labels","id":1360635,"number":12,"title":"Joomla 3.6.0","description":"","creator":{"login":"roland-d","id":359377,"avatar_url":"https://avatars.githubusercontent.com/u/359377?v=3","gravatar_id":"","url":"https://api.github.com/users/roland-d","html_url":"https://github.com/roland-d","followers_url":"https://api.github.com/users/roland-d/followers","following_url":"https://api.github.com/users/roland-d/following{/other_user}","gists_url":"https://api.github.com/users/roland-d/gists{/gist_id}","starred_url":"https://api.github.com/users/roland-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roland-d/subscriptions","organizations_url":"https://api.github.com/users/roland-d/orgs","repos_url":"https://api.github.com/users/roland-d/repos","events_url":"https://api.github.com/users/roland-d/events{/privacy}","received_events_url":"https://api.github.com/users/roland-d/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":450,"state":"open","created_at":"2015-10-17T07:57:38Z","updated_at":"2016-05-08T17:37:12Z","due_on":null,"closed_at":null},"comments":32,"created_at":"2016-05-05T07:57:17Z","updated_at":"2016-05-08T17:37:16Z","closed_at":"2016-05-07T10:54:37Z","pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/10249","html_url":"https://github.com/joomla/joomla-cms/pull/10249","diff_url":"https://github.com/joomla/joomla-cms/pull/10249.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/10249.patch"},"body":"For a reason that I ignore (history I guess), the Login menu item contains a Redirect field in text format.\r\nFor multilanguage (as well as monolanguage), it is better to have a \"menuitem\" type field, which will prevent any error as the redirect should be internal. In that case it is an Itemid which is saved in the database (as already exists for the Logout menu item).\r\nThe issue here was to remain B/C while letting people use the alternative \"menuitem\" field.\r\n\r\nTo accomplish this, I added a new field of type \"menuitem\" (for the login and logout parts of the Login menu item), created 2 new rules, and added showon to let display only one field at a time and throw an alert preventing saving a value both in the ancient \"Login Redirect\"  and the new \"Menu Item Login Redirect\" and as well for \"Logout Redirect\" and the new \"Menu Item Logout Redirect\".\r\n\r\nWhen the menuitem field is used, the patch also checks if Multilang is on and, if it is, adds the necessary lang tag to the redirect.\r\n\r\n_Once this is merge, we will be able to merge a pending PR https://github.com/joomla/joomla-cms/pull/9724 allowing multilanguage users to choose any redirection in the login module too, including associations when automatic change is on._\r\n\r\nNew interface (it is B/C as default is \"Login Redirect\" text field)\r\n\r\n![screen shot 2016-05-05 at 09 48 12](https://cloud.githubusercontent.com/assets/869724/15038722/8bd0eeb4-12a6-11e6-822c-9d03c2166977.png)\r\n\r\nIf choosing \"Menu Item\"\r\n\r\n![screen shot 2016-05-05 at 09 49 26](https://cloud.githubusercontent.com/assets/869724/15038744/c0b3888a-12a6-11e6-8609-23a259e7381c.png)\r\n\r\nTo test, enter internal values in the \"Login redirect\" and \"Logout redirect\" fields, save.\r\nThen patch and test in monolanguage and multilanguage.\r\n\r\nFor example, if both fields are used for login (or/and logout), validation will prevent saving the menu item and we will get a Warning.\r\n\r\n![screen shot 2016-05-05 at 09 53 43](https://cloud.githubusercontent.com/assets/869724/15038810/7551c7b6-12a7-11e6-8cf5-340a3b427a93.png)\r\n\r\nor\r\n\r\n![screen shot 2016-05-05 at 09 56 03](https://cloud.githubusercontent.com/assets/869724/15038826/a0b11eb6-12a7-11e6-977a-dd73cc1c08cb.png)\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/217735401","html_url":"https://github.com/joomla/joomla-cms/pull/10249#issuecomment-217735401","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/10249","id":217735401,"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-05-08T17:37:16Z","updated_at":"2016-05-08T17:37:16Z","body":"Strings modified here: https://github.com/joomla/joomla-cms/pull/10336\r\nplease test"}}