Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Currently, the retain hours limit is limited to 999. I may be better to actually unlimit the value with -1 and allow more then 999 for people who wish to (for instance a month instance or something this kind).
Proposed resolution
I suggest using -1 as per usual Drupalism for unlimited.
It takes to add a hook_update_N() method to change 999 setting to -1.
NOTE: N = 10 to allow this patch to run with #2678056: Flood limit to 99 does not actually set to unlimited. patch proposal already using N = 09
User interface changes
Only the form description on admin/config/people/anonymous_publishing_cl
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#2 | unlimit_retain_time--2678064-2.patch | 3.47 KB | Dom. |
Comments
Comment #2
Dom. CreditAttribution: Dom. as a volunteer commentedCould you please have a review of this patch attached ? Would it be okay ?
Comment #3
Dom. CreditAttribution: Dom. as a volunteer commentedComment #5
gisleWhen reviewing, I spotted two tests where you test against a amended (from 999) magic value for "unlimited" as 0 instad of -1. Here are the diffs, followed by what I think the diff should be:
In
anonymous_publishing.module
:Should be?
In
modules/anonymous_publishing_cl.admin.module
:Should be?
I've already commited your patch to the 7.x-1.x branch, but changed those two lines as indicated above. I've also rolled both updates to the "unlimited" variables into a single update.
Please review and either confirm that my changes are correct, or point out what I've misunderstood.
Comment #6
Dom. CreditAttribution: Dom. as a volunteer commentedHi Gisle:
I guess it best should be
if ($cl_audodelhours != -1) {
in theory.In practice, the point behind
if ($cl_audodelhours) {
is that any negative value would fail becauseif (-2) => FALSE
This is equivalent to your lign
if ($cl_audodelhours >= 0) {
so you can change by it if you think it is prettier code.Comment #7
gisleThis is not correct. Try the following.
On my computer, it produces:
Comment #8
Dom. CreditAttribution: Dom. as a volunteer commentedOh.. you must be right ! Just change it to $
autodelhours >= 0
then !Comment #9
gisleI did that 5 hours ago. Commit
b9c7868
.Changing status to RTBC.
Comment #10
gisleThis is in release 7.x-1.1.
Comment #12
Glottus CreditAttribution: Glottus commentedThis doesn't seem to be working for me using v7-1.1
I get the following error when trying to configure CL settings (leaving this specific option at the desired default -1):
Using 0 doesn't work, either, but I don't WANT a positive integer here (implying that my only option is to have unverified content be automatically deleted at some future point).
Comment #13
gisleThanks for your report @Glottus. Reopening.
Comment #14
Glottus CreditAttribution: Glottus commentedIncidentally, I CAN save the settings by deleting the default provided "-1" and leaving the field blank, but I don't know what effect this will have, nor how to test it, exactly.
Comment #16
gisleComment #17
gisleThis is fixed in the latest snapshot of 7.x-1-x-dev.
Please review.
Comment #18
Glottus CreditAttribution: Glottus commentedI am now able to set "-1" as an option for the retention time. Thanks!
Comment #19
gisleMoving to RTBC based on #18.
Comment #20
gisleFixed in release 7.x-1.2.