Skip to content

Bug: set_checkbox() default value not working  #4582

Description

@NSURLSession0

Describe the bug
The default value in the set_checkbox($field[, $value = ''[, $default = FALSE]]) method is not used. When writing:

var_dump(set_checkbox('field', 'value', true)); 

It prints:
'' (length=0)

This bug was already reported earlier (#3228), but should have been fixed by (#3229). It seems the fix is no longer working.

CodeIgniter 4 version
4.1.1

Affected module(s)
Which package or class is the bug in, if known.

Expected behavior, and steps to reproduce if appropriate
I expect the code above to result in 'true' as 'field' is not set in $_POST.

Context

  • OS: MacOS
  • Web server Apache 2.4.46
  • PHP version 7.4.12

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions