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

Phalcon 5 - Problem in Form element attributes #16123

Closed
niden opened this issue Sep 27, 2022 Discussed in #16122 · 1 comment · Fixed by #16124
Closed

Phalcon 5 - Problem in Form element attributes #16123

niden opened this issue Sep 27, 2022 Discussed in #16122 · 1 comment · Fixed by #16124
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: high High

Comments

@niden
Copy link
Sponsor Member

niden commented Sep 27, 2022

Discussed in #16122

Originally posted by Alistar84 September 27, 2022
Good morning,
I'm trying to migrate my project from v4 to v5.
I noticed some strange behavior in Form class.

When I create a simple element like this:
$username = new Text('username', array('required'=>true, 'class'=>'form-control', 'maxlength'=>50));
I've got an error: Input must be an array or a string.

This happens because the method Phalcon\Html\Escaper->attributes() now accepts only string or array.

If I change the code by putting numbers and booleans between quotes, all works fine:
$username = new Text('username', array('required'=>'true', 'class'=>'form-control', 'maxlength'=>'50'));

I need to edit all my forms elements, or is this a bug?

@niden niden self-assigned this Sep 27, 2022
@niden niden added bug A bug report status: high High 5.0 The issues we want to solve in the 5.0 release labels Sep 27, 2022
@niden niden mentioned this issue Sep 27, 2022
5 tasks
@niden niden linked a pull request Sep 27, 2022 that will close this issue
5 tasks
@niden
Copy link
Sponsor Member Author

niden commented Sep 27, 2022

Resolved in #16124

@niden niden closed this as completed Sep 27, 2022
niden added a commit that referenced this issue Oct 6, 2022
* master:
  Fix typo from Loader registerNamespaces
  add backer
  updating ext and refreshing optimized files
  new version prep
  [#16123] - updated changelog
  [#16123] - corrected attributes escaping - removed array/string check
  [#16123] - changed string checking for level
  more adjustments
  disabling macos for the release; will add when we fix those builds
  [#16123] - updated changelog
  [#16123] - corrected attributes escaping - removed array/string check
  [#16123] - changed string checking for level
  more adjustments
  disabling macos for the release; will add when we fix those builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: high High
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant