Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: form_textarea helper row and col defaults not overwriting when defined as $extra #3412

Closed
durbintl opened this issue Jul 27, 2020 · 3 comments · Fixed by #3415
Closed
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@durbintl
Copy link
Contributor

Describe the bug
The default text area row="10" and col="40" is not overwritten with the value provided, either as an array or string, in the $extra parameter.

CodeIgniter 4 version
CI 4.0.4 (master)

Affected module(s)
Form Helper

Expected behavior, and steps to reproduce if appropriate
Currently form_textarea('demo', '', ['rows'=>'4', 'cols'=>'10']) and form_textarea('demo', '', 'rows="4" cols="10"') would both output <textarea name="mailingaddress" cols="40" rows="10" rows="4" cols="10"></textarea>.

Context

  • OS: macOS Catalina 10.15.5
  • Web server Apache 2.2.34
  • PHP version 7.4.2
@durbintl durbintl added the bug Verified issues on the current code behavior or pull requests that will fix them label Jul 27, 2020
@nyufeng
Copy link
Contributor

nyufeng commented Jul 27, 2020

see: https://codeigniter4.github.io/userguide/helpers/form_helper.html#form_textarea

form_textarea( ['rows'=>'4', 'cols'=>'10']);
form_textarea([
    "id" => "form-text",
    "rows" => 12,
    "cols" => 15,
    "class" => ".form-area"
],"Hello world", 'style="color:read;font-size:12px;"');

//out

<textarea cols="15" rows="12" id="form-text" class=".form-area"  style="color:read;font-size:12px;">Hello world</textarea>

@durbintl
Copy link
Contributor Author

@Instrye What you are suggesting does function as expected, however this bug targets the third parameter $extra in form_textarea([$data = ''[, $value = ''[, $extra = '']]]). Of course we could remove the second and third parameters, but since the code is already in use, that would not be wise less an update should break a site. :)

@durbintl
Copy link
Contributor Author

PR is in testing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants