When a user visit the terms of user page and accept the terms, eventually they get the error:
NOTICE: PHP message: Uncaught PHP Exception InvalidArgumentException: "The user-entered string '' must begin with a '/', '?', or '#'." at /var/www/html/web/core/lib/Drupal/Core/Url.php line 204
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | agreement-3026684-fix-exception-6.patch | 6.04 KB | mradcliffe |
| #6 | interdiff-3026684-2-6.txt | 5.51 KB | mradcliffe |
| #6 | agreement-3026684-fix-exception-testonly-6.patch | 3.69 KB | mradcliffe |
| #2 | fix-exception-3026684.patch | 542 bytes | rfsbsb |
Comments
Comment #2
rfsbsbPatch attached
Comment #3
rfsbsbComment #4
mradcliffeThank you for contributing a patch, @rfsbsb.
We should set the issue to Needs Review and keep the Version at the latest dev release so that the patch is run through automated tests. I set these to see how the patch goes.
I see the issue, but would you be able to provide a few more steps to reproduce and add those to the issue summary, @rfsbsb?
Also, it may also be good to set the defaults to '/' in the default agreement as well as in getSettings on the Agreement entity, but there will be a merge conflict with #2991481: Excess PHP notices as well.
Comment #5
rfsbsbHi @mradcliffe,
Thanks for clarifying about the version. I've actually tested this patch against both alpha1 and -dev and it applied to both.
As for the steps to reproduce:
This is because somehow the user does not get a proper destination URL, causing the URL formation invalid.
Comment #6
mradcliffeThank you!
I found the bug in the tests where I believe I worked around this bug. I also realized my question in #5 about not setting blank anymore didn't make sense after I re-read current expected behavior.
Here's an updated patch that fixes the test (and some code standard cleanups). The testonly patch should fail with the error in the summary, and the other patch will show that it passes.
Comment #8
mradcliffeYep, the exception is shown on Drupal_Tests_agreement_Functional_AgreementCustomUnprivilegedUserTest-52-51065470.html. :-)
Comment #10
mradcliffeWent ahead and committed and rolled a new tag.