-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix broken form getMessages #13295
Fix broken form getMessages #13295
Conversation
Will check it out soon. |
@mbrostami Could you please update change log too. |
phalcon/forms/form.zep
Outdated
@@ -370,10 +370,23 @@ class Form extends Injectable implements \Countable, \Iterator | |||
*/ | |||
public function getMessages(boolean byItemName = false) -> <Group> |
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.
public function getMessages(boolean byItemName = false) -> <Group> | array
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.
Could you please amend PHPDoc by adding examples from the #13294 issue
phalcon/forms/form.zep
Outdated
/** | ||
* This part of code is for backward compatibility, it should be removed in next major version | ||
*/ | ||
if byItemName { |
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.
if unlikely byItemName
For more see: https://stackoverflow.com/a/11227902/1661465
phalcon/forms/form.zep
Outdated
if byItemName { | ||
let messagesByItem = []; | ||
for elementMessage in messages { | ||
if !isset messagesByItem[elementMessages->getField()] { |
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.
it seems to me if fetch
will be faster
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.
anyway here is typo elementMessage
not elementMessages
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.
I couldn't find the way to use if fetch
, refer to this link https://docs.zephir-lang.com/en/latest/operators.html#fetch I thought that isset
is faster than fetch
, please let me know if I'm wrong.
@sergeyklay Done. |
@mbrostami Thank you for quick reply and fixes |
Hello!
In raising this pull request, I confirm the following (please check boxes):
Small description of change:
Thanks