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

Islandora Settings offers invalid time expression #1498

Closed
kayakr opened this issue May 4, 2020 · 5 comments
Closed

Islandora Settings offers invalid time expression #1498

kayakr opened this issue May 4, 2020 · 5 comments

Comments

@kayakr
Copy link
Contributor

kayakr commented May 4, 2020

On Islandora Settings in Drupal (/admin/config/islandora/core) the JWT Expiry field description suggests times like 60, "2 days", "10h", "7d" but if you try 7d the form errors with "7d" is not a valid time or interval expression." Do the offered times all need "+" added, e.g. +7d works.
Screen Shot 2020-05-05 at 11 35 17 AM

@seth-shaw-unlv
Copy link
Contributor

seth-shaw-unlv commented May 4, 2020

Ah, you are right. It validates using strtotime. All the examples should be valid relative forms which, for the existing ones, require the "+" sign at the beginning (because using the minus makes no sense in this context). The line to update is here.

@whikloj
Copy link
Member

whikloj commented May 13, 2020

Would this benefit from some help in the validation function? Like assuming/requiring a + because a JWT with a - is kinda useless.

@seth-shaw-unlv
Copy link
Contributor

@whikloj, sure. The validation code currently insists it is a valid time, although we could improve the validation error message.

@rosiel
Copy link
Member

rosiel commented Sep 10, 2021

Still an issue, in a way. '2 days' does not validate because 'day' is not listed as one of the valid time intervals. Yet it's in the suggested text.
Screen Shot 2021-09-10 at 4 34 05 PM

@seth-shaw-unlv
Copy link
Contributor

Thanks, @rosiel for wrapping this up for us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants