{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/11207","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11207/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11207/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11207/events","html_url":"https://github.com/joomla/joomla-cms/pull/11207","id":166388517,"number":11207,"title":"New field attribute \"showon_ext\"","user":{"login":"jo-sf","id":8342125,"avatar_url":"https://avatars.githubusercontent.com/u/8342125?v=3","gravatar_id":"","url":"https://api.github.com/users/jo-sf","html_url":"https://github.com/jo-sf","followers_url":"https://api.github.com/users/jo-sf/followers","following_url":"https://api.github.com/users/jo-sf/following{/other_user}","gists_url":"https://api.github.com/users/jo-sf/gists{/gist_id}","starred_url":"https://api.github.com/users/jo-sf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jo-sf/subscriptions","organizations_url":"https://api.github.com/users/jo-sf/orgs","repos_url":"https://api.github.com/users/jo-sf/repos","events_url":"https://api.github.com/users/jo-sf/events{/privacy}","received_events_url":"https://api.github.com/users/jo-sf/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,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-07-19T17:29:58Z","updated_at":"2016-07-21T01:45:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/11207","html_url":"https://github.com/joomla/joomla-cms/pull/11207","diff_url":"https://github.com/joomla/joomla-cms/pull/11207.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/11207.patch"},"body":"#### Summary of Changes\r\n\r\nBy means of the new field attribute \"showon_ext\" you can make a field dependent upon any global setting or any setting with any component much the same way as the attribute \"showon\" does for other fields in the same form. The syntax in the \"showon_ext\" attribute is identical to the syntax in the \"showon\" attribute with the following modification: you have to add either the string \"global\" or the name of a component followed by a colon at the beginning of each check.\r\n\r\nYou might add this new attribute to any field in any form where this field shall only be shown in this form if one or more global settings and/or component settings have distinct values.\r\n\r\n#### Testing Instructions\r\n\r\nIn order to test this PR you have to change a field definition in any form and make this field dependant upon one or more global settings and/or component settings (no such change is currently part of this PR).\r\n\r\nFor the following test you need a Joomla installation that is reachable both via HTTP and HTTPS.\r\n\r\nA candidate I can suggest is the form in `modules/mod_login/mod_login.xml`. Change the definition of the \"usesecure\" field as follows:\r\n\r\n```\r\n<field\r\n        name=\"usesecure\"\r\n        type=\"radio\"\r\n        label=\"MOD_LOGIN_FIELD_USESECURE_LABEL\"\r\n        description=\"MOD_LOGIN_FIELD_USESECURE_DESC\"\r\n        class=\"btn-group btn-group-yesno\"\r\n        default=\"0\"\r\n        showon_ext=\"global:force_ssl:0,1\"\r\n        >\r\n        <option value=\"1\">JYES</option>\r\n        <option value=\"0\">JNO</option>\r\n</field>\r\n```\r\n\r\nThe line starting with \"showon_ext=\" is the new line in this definition, I made no other changes here.\r\n\r\nNext go to the global configuration and check that the \"Force HTTPS\" setting is either \"None\" or \"Administrator Only\". If the setting is \"Entire Site\" change it accordingly.\r\n\r\nNext go to \"Extensions\" => \"Modules\" and search for all site modules containing \"login\" in their names (with the basic examples installed you should have three such modules).\r\n\r\nOpen one of these modules and check that the field \"Encrypt Login Form\" exists (second but last at the \"Module\" tab). Close this module.\r\n\r\nNext go again to the global configuration and set the \"Force HTTPS\" setting to \"Entire Site\".\r\n\r\nReturn to \"Extensions\" => \"Modules\" and reopen the module you checked before. The field \"Encrypt Login Form\" shall no longer exist. Close this module."},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/234134570","html_url":"https://github.com/joomla/joomla-cms/pull/11207#issuecomment-234134570","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11207","id":234134570,"user":{"login":"ggppdk","id":5092940,"avatar_url":"https://avatars.githubusercontent.com/u/5092940?v=3","gravatar_id":"","url":"https://api.github.com/users/ggppdk","html_url":"https://github.com/ggppdk","followers_url":"https://api.github.com/users/ggppdk/followers","following_url":"https://api.github.com/users/ggppdk/following{/other_user}","gists_url":"https://api.github.com/users/ggppdk/gists{/gist_id}","starred_url":"https://api.github.com/users/ggppdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggppdk/subscriptions","organizations_url":"https://api.github.com/users/ggppdk/orgs","repos_url":"https://api.github.com/users/ggppdk/repos","events_url":"https://api.github.com/users/ggppdk/events{/privacy}","received_events_url":"https://api.github.com/users/ggppdk/received_events","type":"User","site_admin":false},"created_at":"2016-07-21T01:45:25Z","updated_at":"2016-07-21T01:45:25Z","body":"> This would also encourage coupling between components.\r\n\r\nThis help in reduce configuration options. If we display all of the fields, then the coupling will be less because we display all of them ?\r\nWhat if we remove the ability for components and only allow this attribute to use global config ?\r\nis it more acceptable ?\r\n\r\n> What's the use-case?\r\n\r\nThis helps configuration UI be less clattered, and hide fields that are not used during configuration\r\n\r\n> At the same time this feature here could already be easily done with a custom formfield.\r\n\r\nyou mean \r\n- extend all Joomla form fields to add an attribute ?\r\n- or do you mean create a single \"wrapper\" field that instatiate other fields ?\r\n\r\nis making configuration simpler for the user a good purpose ?\r\nthis a trade-off, maybe it is not worth having,\r\n\r\nstill it feels like a natural extension of showon capabilities"}}
{"actor":{"display_login":"ggppdk"}}