I'm trying to disable breaking locks based on time. When set to 0, I get 'You must set your content lock timeout value to a positive number' for Lock timeout.

I see this on line 45 of content_lock/modules/content_lock_timeout/content_lock_timeout.module
The less than or equal to sign should be set to be just a less than sign.

function content_lock_timeout_admin_settings_validate($form, &$form_state) {
if (!is_numeric($form_state['values']['content_lock_timeout_minutes'])
|| $form_state['values']['content_lock_timeout_minutes'] <= 0) {
form_set_error('content_lock_timeout_minutes', t('You must set your content lock timeout value to a positive number.'));
}
}

Perhaps all that needs to happen is to change the sentence that says

'Set to zero to not break locks based on time.'

to say

'Disable the content locking timeouts module to not break locks based on time'

but it would be nice if setting this value to zero would disable the auto breaking of locks as well.

Comments

ohnobinki’s picture

Component: Code » Documentation
Assigned: Unassigned » ohnobinki
Priority: Normal » Minor
Status: Active » Fixed

but it would be nice if setting this value to zero would disable the auto breaking of locks as well.

What do you mean by this? I don't understand a way to automatically break locks without at least having a timeout. Perhaps you want an option to disable breaking locks through the cronjob and only automatically break locks when users try to edit nodes? That would be a different feature.

However, thanks for filing this bug. I wrote the line about setting the timeout to `0' before content_lock_timeouts was its own module -- I wrote it as part of the main content_lock module. Now it makes much more sense to disable the module itself than to have the module have a ``don't do anything'' mode ;-).

In git: https://github.com/EugenMayer/content_lock/commit/4aa9b1c58fcbc652be4d7f...

ohnobinki’s picture

hmm... seems that drupal ate my attempt at adding a comment:

but it would be nice if setting this value to zero would disable the auto breaking of locks as well.

What do you mean by this? I don't understand a way to automatically break locks without at least having a timeout. Perhaps you want an option to disable breaking locks through the cronjob and only automatically break locks when users try to edit nodes? That would be a different feature, but seems plausible to me.

However, thanks for filing this bug. I wrote the line about setting the timeout to `0' before content_lock_timeouts was its own module -- I initially wrote it as part of the main content_lock module. Now, since it's a separate module, it makes much more sense to disable the module itself than to have the module have a ``don't do anything'' mode ;-).

I threw this in git: https://github.com/EugenMayer/content_lock/commit/4aa9b1c58fcbc652be4d7f...

eugenmayer’s picture

seconds ohnobinki. Thanks!

darrellduane’s picture

I don't see a way to automatically break locks without having a timeout, either.

All I meant by this was to say that I thought it would be a good idea to still be able to put a 0 in this field and have it essentially disable the module. Perhaps thats redundant and confusing, but for me its easier to go in and set a 0 there, knowing that I want to have easy access to the module's functionality and then change it to another time that makes it active rather than wading through the sea of modules and disabling it and then later wading through the sea of modules again to enable it and then go and set the time that I want it to time out at.

eugenmayer’s picture

Well i see your point Darell but i really think its better having exactly one way. If you dont need the functionality for timeout-locks, dont enable the module. If you need it, enable it and you are set to go.

Its really not effort allowing 0, but it simply does not make to much sense confusing people here.

I hope its ok for you though

darrellduane’s picture

gotcha! Thanks for all you do!

Status: Fixed » Closed (fixed)

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