After working with this module, and figuring out a workflow for page approvals on a project im working on. I got a request that it would be nice to have an option to create a custom lifetime for the access token, on both the configuration page and on the node edit form.
My thought is that when the module is enabled, you still have all of the current lifetime options in the dropdown, with an additional "custom" selection. When that is selected, a text input field shows up below the dropdown that allows the user to input in a custom hour value. Or it could be more specific to allow the user to input the day, hour, and second fields. Then when you save, the module calculates the duration of the custom values, and saves that duration value in seconds like the rest of the lifetime options.
I'm working on this on my free time, and will post a patch when I have something close to this functionality.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | custom-lifetime-access-token-2942249-4.patch | 3.85 KB | Cecilina |
| #3 | custom-lifetime-access-token-2942249-3.patch | 3.85 KB | Cecilina |
Issue fork access_unpublished-2942249
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
c_c commentedComment #3
Cecilina commentedCreate a patch only for entity form alert part using custom option.
Comment #4
Cecilina commentedFix coding standard else if to elseif
Comment #5
generalredneckComment #6
generalredneck@mably,
I forgot that this issue was laying around. It's very similar to you hook in #3559355: Add an alter hook to allow customization of the duration options.
I wonder if we should support both. The hook makes for an easy set of ready used options... but this one would allow for those one off instances where someone needs longer times?
Comment #7
mably commentedWe could add a 'custom expiration' entry in the options list.
And when the 'custom expiration' entry is selected, we display an input field allowing to enter a custom expiration value.
EDIT: Ok, looks like it's what is suggested in the patch. Will create an MR.
It’s still useful to have the hook if we want to be able to disable this feature (which we will).
Comment #9
mably commentedMR created. Functional Javascript test added.
Comment #11
mably commented