Skip to content

Correct display of a select list for a boolean config item - #975

Merged
aulona1 merged 1 commit into
phpList:release-3.6.14from
bramley:php8_boolean_config
Sep 13, 2023
Merged

Correct display of a select list for a boolean config item#975
aulona1 merged 1 commit into
phpList:release-3.6.14from
bramley:php8_boolean_config

Conversation

@bramley

@bramley bramley commented Aug 1, 2023

Copy link
Copy Markdown
Contributor

Description

When editing a boolean item on the Settings page, such as "Send notifications about subscribe, update and unsubscribe", the select list of Yes and No should show the current value but shows Yes when the current value is actually No.
The code to select No is now incorrect due to php 8 being stricter about comparisons.

The value for a boolean seems to be "1" for true and an empty string for false. Previously $value == 0 would also be true when $value is an empty string.

if ($value === false || $value == 'false' || $value == 0) {

Related Issue

Screenshots (if appropriate):

image

@michield
michield self-requested a review August 1, 2023 20:26
@michield

michield commented Aug 1, 2023

Copy link
Copy Markdown
Member

not tested, but looks fine to me

@aulona1
aulona1 changed the base branch from main to release-3.6.14 September 13, 2023 14:44
@aulona1
aulona1 merged commit 1ea33a5 into phpList:release-3.6.14 Sep 13, 2023
@phpListDockerBot

Copy link
Copy Markdown
Contributor

This pull request has been mentioned on phpList Discuss. There might be relevant details there:

https://discuss.phplist.org/t/3-6-14-release-candidate-ready-for-testing/9109/1

@bramley
bramley deleted the php8_boolean_config branch September 18, 2023 22:26
@phpListDockerBot

Copy link
Copy Markdown
Contributor

This pull request has been mentioned on phpList Discuss. There might be relevant details there:

https://discuss.phplist.org/t/phplist-3-6-14-released-security-release/9158/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants