-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.4] Fixed missing maxlength attribute in textarea.php #34646
base: 4.4-dev
Are you sure you want to change the base?
Conversation
The Max Length was printing just the NUMBER as the attribute instead of maxlength="NUMBER"
Co-authored-by: Quy <quy@fluxbb.org>
I am not able to reproduce this issue. Created a custom text area field with maxlength value. |
@Quy , according to the textarea field layout code this will only work if the I just noticed there's no |
Your PR will break the custom textarea field. See markup.
|
The character count requires two attributes in the xml
|
@machadoug You have the same issue with |
@machadoug I suspect you use the textarea layout with your own field, joomla-cms/libraries/src/Form/Field/TextareaField.php Lines 180 to 189 in 3544d8b
It looks strange to me, but it works like that since ~3.7 version |
I was indeed using a custom Textarea field in my extension. I was under the impression that we should use only the attribute value, not Maybe we should include something in the code documentation explaining it's a string and not an integer? * @var string $rows rows attribute for the field.
* @var string $cols cols attribute for the field.
* @var string $maxlength maxlength attribute for the field. |
That is correct expectation. Would be good to fix it. Only need to care about backward compatibility here. joomla-cms/libraries/src/Form/Field/TextareaField.php Lines 179 to 181 in 3544d8b
to the layout. And in layout doing something like: $maxlengthAttr = '';
if ($maxlengt)
{
$maxlengthAttr = is_numeric($maxlength) ? ' maxlength="' . $maxlength . '"' : $maxlength;
} The same for rows and cols attribute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added attributes to doc block and fixed according to @Fedik suggestions.
I just didn't include the changes to joomla-cms/libraries/src/Form/Field/TextareaField.php because I don't know how to include it to this PR.
@machadoug I have added that changes to your PR It ready for testing: |
This pull request has been automatically rebased to 4.4-dev. |
Summary of Changes
The Max Length was printing just the NUMBER as the attribute instead of maxlength="NUMBER"
Testing Instructions
See screenshot
Actual result BEFORE and AFTER applying this Pull Request
fixed-textarea-max-length-attribute.mp4
Documentation Changes Required
None