{"action":"created","issue":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/3036","repository_url":"https://api.github.com/repos/IQSS/dataverse","labels_url":"https://api.github.com/repos/IQSS/dataverse/issues/3036/labels{/name}","comments_url":"https://api.github.com/repos/IQSS/dataverse/issues/3036/comments","events_url":"https://api.github.com/repos/IQSS/dataverse/issues/3036/events","html_url":"https://github.com/IQSS/dataverse/issues/3036","id":143975352,"number":3036,"title":"Support Form: math challenge doesn't work from some pages","user":{"login":"pdurbin","id":21006,"avatar_url":"https://avatars.githubusercontent.com/u/21006?v=3","gravatar_id":"","url":"https://api.github.com/users/pdurbin","html_url":"https://github.com/pdurbin","followers_url":"https://api.github.com/users/pdurbin/followers","following_url":"https://api.github.com/users/pdurbin/following{/other_user}","gists_url":"https://api.github.com/users/pdurbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pdurbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdurbin/subscriptions","organizations_url":"https://api.github.com/users/pdurbin/orgs","repos_url":"https://api.github.com/users/pdurbin/repos","events_url":"https://api.github.com/users/pdurbin/events{/privacy}","received_events_url":"https://api.github.com/users/pdurbin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Type:%20Bug","name":"Type: Bug","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-28T13:16:51Z","updated_at":"2016-03-28T15:29:08Z","closed_at":null,"body":"In #1327 we added a simple math challenge to slow spammers down from filling out the support form but in some places the operands are now missing. For example on https://demo.dataverse.org running v. 4.3 build 22-1e451ff if you sign up, click the \"welcome\" notification, and click \"Dataverse Support\", you don't see any number to add together:\r\n\r\n![account_-_demo_dataverse_-_2016-03-28_09 01 11](https://cloud.githubusercontent.com/assets/21006/14078442/d8b7e4d6-f4c3-11e5-970f-08c72dcc4eb0.png)\r\n\r\nAs noted by @kcondon this regression appears in additional places in the Shib-related pull request at #3025 as of 4d332e0:\r\n\r\n- 403 pages: https://shibtest.dataverse.org/403.xhtml\r\n- 404 pages: https://shibtest.dataverse.org/404.xhtml\r\n- Login Page when Shib is enabled: https://shibtest.dataverse.org/loginpage.xhtml\r\n\r\nInterestingly, if you click the normal \"Support\" link in the header first, the problem goes away. From a quick look it seems like the problem started happening when we staring using constructions like `<a href=\"#\" onclick=\"event.preventDefault();PF('contactForm').show();\">Dataverse Support</a>` in Bundle.properties. I'm not actually sure what the fix should be. Here's a list of where this construction is used in pull request #3025:\r\n\r\n```\r\nmurphy:dataverse pdurbin$ grep contactForm src/main/java/Bundle.properties | grep -i onclick | sed G\r\n\r\nuser.isShibUser=Account information cannot be edited when logged in through an institutional account. Leaving your institution? Please contact <a href=\"#\" onclick=\"event.preventDefault();PF('contactForm').show();\">Dataverse Support</a> for assistance.\r\n\r\nnotification.welcome=Welcome to {0} Dataverse! Get started by adding or finding data. Have questions? Check out the <a href=\"{1}/{2}/user/index.html\" title=\"{0} Dataverse User Guide\" target=\"_blank\">User Guide</a> or contact <a href=\"#\" onclick=\"event.preventDefault();PF(&#39;contactForm&#39;).show();\" title=\\u201dContact {0} Dataverse Support\\u201d>Dataverse Support</a> for assistance.\r\n\r\nlogin.institution.support=Leaving your institution? Please contact <a href=\"#\" onclick=\"event.preventDefault();PF('contactForm').show();\">Dataverse Support</a> for assistance.\r\n\r\nerror.404.message=<strong>Page Not Found</strong> - The page you are looking for was not found. If you believe this is an error, please contact <a href=\"#\" onclick=\"event.preventDefault();PF('contactForm').show();\">Dataverse Support</a> for assistance.\r\n\r\nerror.403.message=<strong>Not Authorized</strong> - You are not authorized to view this page. If you believe this is an error, please contact <a href=\"#\" onclick=\"event.preventDefault();PF('contactForm').show();\">Dataverse Support</a> for assistance.\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/comments/202439945","html_url":"https://github.com/IQSS/dataverse/issues/3036#issuecomment-202439945","issue_url":"https://api.github.com/repos/IQSS/dataverse/issues/3036","id":202439945,"user":{"login":"pdurbin","id":21006,"avatar_url":"https://avatars.githubusercontent.com/u/21006?v=3","gravatar_id":"","url":"https://api.github.com/users/pdurbin","html_url":"https://github.com/pdurbin","followers_url":"https://api.github.com/users/pdurbin/followers","following_url":"https://api.github.com/users/pdurbin/following{/other_user}","gists_url":"https://api.github.com/users/pdurbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pdurbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdurbin/subscriptions","organizations_url":"https://api.github.com/users/pdurbin/orgs","repos_url":"https://api.github.com/users/pdurbin/repos","events_url":"https://api.github.com/users/pdurbin/events{/privacy}","received_events_url":"https://api.github.com/users/pdurbin/received_events","type":"User","site_admin":false},"created_at":"2016-03-28T15:29:07Z","updated_at":"2016-03-28T15:29:07Z","body":"@scolapasta thanks for agreeing during this morning's standup to take a look at this issue. Again, the easiest fix is to remove the `onclick ... PF` stuff from https://github.com/IQSS/dataverse/blob/v4.3/src/main/java/Bundle.properties#L129 for example and have it say \"Click the link in the header\" but maybe you can come up with a better fix. @landreev seems to agree that PrimeFaces code doesn't really belong in the bundle and if that's the case maybe we should put this in our style guide: http://guides.dataverse.org/en/4.3/developers/coding-style.html\r\n\r\n@scolapasta during the meeting I said I'd also give two more issues to you that were kicked back to me. Here are links to the comments from @kcondon:\r\n\r\n- https://github.com/IQSS/dataverse/issues/2046#issuecomment-202388249\r\n- https://github.com/IQSS/dataverse/issues/2951#issuecomment-202388309\r\n\r\nSince the [2939-shib](https://github.com/IQSS/dataverse/tree/2939-shib) branch that pull request #3025 is based on is particularly effected, I would suggest fixing the problem there."}}