{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/13476","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/13476/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/13476/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/13476/events","html_url":"https://github.com/joomla/joomla-cms/pull/13476","id":198854894,"number":13476,"title":"[showon] Allow \"not in\" condition and simplify php code","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":[{"id":60721348,"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-01-05T01:32:01Z","updated_at":"2017-01-05T14:55:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/13476","html_url":"https://github.com/joomla/joomla-cms/pull/13476","diff_url":"https://github.com/joomla/joomla-cms/pull/13476.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/13476.patch"},"body":"Pull Request for Improvement.\r\n\r\n### Summary of Changes\r\n\r\nThis PE does two things:\r\n- Add a new \"not in\" condition to shown, we can use this condition by making use of the `!:` operator, insteadd of the normal `:`. This is particular useful if you want to put, for instance: field A should show on when fieldB value is not empty, ie, `showon=\"fieldB!:\"`, which is not possible without this PR\r\nExample: \r\n```php\r\n// - Current\r\n// Field A with value in 1 OR field B with value IN 1, 2 or 3\r\nfieldname:1[OR]fieldB:1,2,3\r\n\r\n// - NEW\r\n// Field A with value in 1 OR field B with value NOT IN 1, 2 or 3\r\nfieldname:1[OR]fieldB!:1,2,3\r\n```\r\n- Normalizes showon php code across the core. Remvoe a lot of duplicated code.\r\n\r\n### Testing Instructions\r\n\r\n1. Apply patch\r\n2. Confirm current fields with showon behaviour continue to work fine\r\n3. Change [this line](https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_config/model/form/application.xml#L553) line in com_config xml so the showon condition is `mailonline:1[AND]mailer!:smtp`.\r\nNow check this field will appear when the field `mailonline` is set to yes and the mailer is different than smtp.\r\n4. Make any other tests you can remember\r\n\r\n### Documentation Changes Required\r\n\r\nAdd this new operator to https://docs.joomla.org/Form_field#Showon\r\n"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/270662672","html_url":"https://github.com/joomla/joomla-cms/pull/13476#issuecomment-270662672","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/13476","id":270662672,"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},"created_at":"2017-01-05T14:55:24Z","updated_at":"2017-01-05T14:55:24Z","body":"@joomdonation yeah it was a bug forgot to change a thing. should be solved now."}}
{"actor":{"display_login":"andrepereiradasilva"}}