Skip to:
Content

bbPress.org

Opened 5 years ago

Closed 4 years ago

Last modified 3 years ago

#3386 closed defect (bug) (fixed)

Allow editing posts forever is not configurable.

Reported by: peterkueger's profile peterkueger Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6.7 Priority: normal
Severity: normal Version:
Component: API - Settings/Options Keywords:
Cc:

Description

Inside the settings of bbPress, there is an option called "Editing". If I enable it and set it to "0", the users should be able to edit endless.

But if I set it to "0" and let the change apply, it will be reset to "5". I can set it to "1", to "5" and to "100" - but not to "0".

Is this a bug? If not: How can I allow the users to edit their post forever?

Change History (7)

#1 @Robin W
5 years ago

it is a bug, and I think there is a trac ticket, but I can't immediately find it

I just set it to 5256000 which is ten years - if you're still editing after that, then maybe you need a long hard look at your life :-)

#2 @peterkueger
5 years ago

I analyzed this bug more detailed:

If I set the value to "0" it will apply into the options table of WordPress.

But if I reopen the website of the bbPress options, it shows the default value (5) nevertheless.

This happens, since in the function "bbp_admin_setting_callback_editlock" it will be fetched with "bbp_form_option", which calls "bbp_get_form_option". Inside this function, there is a check:

if ( empty( $value ) ) {
  $value = $default;
}

"empty" checks, if "$value" is a valid value is set:
https://www.php.net/manual/en/function.empty.php

But "0" will not be accepted as valid, so it applies the "$default" value.

Imho, the shown code should just remove completely.

@johnjamesjacoby: Is this analyzes helpful for you, or do you want more support from people like me?

Last edited 5 years ago by peterkueger (previous) (diff)

#3 @peterkueger
4 years ago

Since you didn't fix this bug, I uninstalled bbPress.

#4 @johnjamesjacoby
4 years ago

  • Component changed from General to API - Settings/Options
  • Milestone changed from Awaiting Review to 2.6.7
  • Owner set to johnjamesjacoby
  • Status changed from new to accepted

#5 @johnjamesjacoby
4 years ago

In 7179:

Replies: allow zero value bbp_get_form_option().

This commit specifically re-allows for infinite editing of topics and replies to work as intended. Previous to this, it was impossible to retrieve a "0" value, even though the setting description claims that it is possible and it would be saved correctly in the database.

In trunk for 2.7.0. See #3386.

#6 @johnjamesjacoby
4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 7180:

Replies: allow zero value bbp_get_form_option().

This commit specifically re-allows for infinite editing of topics and replies to work as intended. Previous to this, it was impossible to retrieve a "0" value, even though the setting description claims that it is possible and it would be saved correctly in the database.

In branches/2.6 for 2.6.7. Fixes #3386.

#7 @johnjamesjacoby
3 years ago

#3437 was marked as a duplicate.

Note: See TracTickets for help on using tickets.