Problem/Motivation

Currently, when the expiration value is UserRestrictions::NO_EXPIRY (2147483647) the restrictions do not expire, but when the expiration value is 0, the restrictions are considered expired.
Is not possible to get 0 from the datetime form element. It would be better to use 0 for restrictions that do not expire.

Proposed resolution

Wherever UserRestrictions::NO_EXPIRY is used, replace it with 0.

Command icon 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

avpaderno created an issue. See original summary.

avpaderno’s picture

Title: Use 0 as expiration value for restriction that do not expire » Use 0 as expiration value for restrictions that do not expire

  • avpaderno committed 646dd613 on 3.0.x
    Issue #3550956: Use 0 as expiration value for restrictions that do not...
avpaderno’s picture

Assigned: avpaderno » Unassigned
Status: Active » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

avpaderno’s picture

Finally, I decided to use a new property that is set to TRUE when a restriction does not expire. In this way, when a restriction is set to expire, and then as not expiring, the expiring time is preserved, even if it is not used when the restriction does not expire.