Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Captcha question in contact form doesn't appear on 403 error page #10466

Closed
jeromeroucou opened this issue Apr 5, 2024 · 2 comments · Fixed by #10602
Closed

Captcha question in contact form doesn't appear on 403 error page #10466

jeromeroucou opened this issue Apr 5, 2024 · 2 comments · Fixed by #10602
Labels
Type: Bug a defect
Milestone

Comments

@jeromeroucou
Copy link
Contributor

What steps does it take to reproduce the issue?

  • When does this issue occur?

When a authenticated user requests access to a resource (URL) for which he doesn't have rights (for example, a dataset in draft mode).

  • Which page(s) does it occurs on?

On the 403 error page, or "Not Authorized"

  • What happens?

A 403 error page is displayed, and telling to the user he or she doesn't have rights, with a link opening a contact form. In this case, the question "Please fill this out to prove you are not a robot." only display + =. And when the form is submitted, a NullPointerException is thrown, indicating that variable op1 is null.

  • To whom does it occur (all users, curators, superusers)?

All users who doesn't have the correct privilege on the asked resource.

  • What did you expect to happen?

The contact form have to be complete with the captcha question

Which version of Dataverse are you using?

5.14, but there is present on 6.2 (develop branch)

Any related open or closed issues to this bug report?

I don't find any other issue on this theme.

Screenshots:

403_error_contact_form

@jeromeroucou jeromeroucou added the Type: Bug a defect label Apr 5, 2024
@pdurbin
Copy link
Member

pdurbin commented Apr 9, 2024

Huh, this reminds me of this issue:

Which we (partially?) fixed in this PR:

@jeromeroucou
Copy link
Contributor Author

Indeed, the problem seems to be linked to the linked issue. I doesn't know why but in case of 403 error page, actionListener="#{sendFeedbackDialog.initUserInput}" isn't called.

A quick fix can be to add a verification on opX parameters, for example :

public String getMessageTo() {
+    if (op1 == null or op2 == null) {
+        initUserInput(null);
+    }
    if (feedbackTarget == null) {
        return BrandingUtil.getSupportTeamName(systemAddress);
    } else if (feedbackTarget.isInstanceofDataverse()) {
        return ((Dataverse) feedbackTarget).getDisplayName() + " " + BundleUtil.getStringFromBundle("contact.contact");
    } else {
        return BundleUtil.getStringFromBundle("dataset") + " " + BundleUtil.getStringFromBundle("contact.contact");
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug a defect
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants