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

[Form validation] Check if validation[field] !== undefined before accessing any of it's properties #546

Merged
merged 2 commits into from
Mar 12, 2019

Conversation

iarspider
Copy link
Contributor

@iarspider iarspider commented Mar 8, 2019

Description

When executing form("remove fields", field) check if validation[field] !== undefined` before accessing any of it's properties

Testcase

Screenshot (when possible)

[form remove rule] Check if `validation[field] !== undefined` before accessing any of it's properties
@ghost
Copy link

ghost commented Mar 8, 2019

There were the following issues with this Pull Request

  • Commit: 140c615
    • ✖ message may not be empty
    • ✖ type may not be empty

You may need to change the commit messages to comply with the repository contributing guidelines.


🤖 This comment was generated by commitlint[bot]. Please report issues here.

Happy coding!

@y0hami y0hami added lang/javascript Anything involving JavaScript state/awaiting-reviews Pull requests which are waiting for reviews needs more info labels Mar 8, 2019
@y0hami
Copy link
Member

y0hami commented Mar 8, 2019

@iarspider Can you add a jsfiddle showing an example which this PR fixes.

@iarspider
Copy link
Contributor Author

iarspider commented Mar 8, 2019

@hammy2899 sure: https://jsfiddle.net/eyzaq7k6/
After clicking "Submit", this is logged in the js console:

TypeError: validation is undefined[Learn More] semantic.js:1274:15
	rule https://fomantic-ui.com/dist/semantic.js:1274
	field https://fomantic-ui.com/dist/semantic.js:1294
	each jQuery
	field https://fomantic-ui.com/dist/semantic.js:1293
	fields https://fomantic-ui.com/dist/semantic.js:1309
	invoke https://fomantic-ui.com/dist/semantic.js:1719
	initialize https://fomantic-ui.com/dist/semantic.js:590
	form https://fomantic-ui.com/dist/semantic.js:1736
each2jQuery	form https://fomantic-ui.com/dist/semantic.js:545
	onload https://fiddle.jshell.net/_display/:41
dispatch2jQuery

y0hami
y0hami previously approved these changes Mar 8, 2019
Copy link
Member

@y0hami y0hami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y0hami y0hami added this to the 2.7.3 milestone Mar 8, 2019
prudho
prudho previously approved these changes Mar 8, 2019
Copy link
Contributor

@prudho prudho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@lubber-de lubber-de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although your fix is correct, you applied it to the dist-folder file, which is generated at build time.
In order to get this correctly merged into the next version, please apply your changes to
Fomantic-UI/src/definitions/behaviors/form.js
instead

@iarspider iarspider dismissed stale reviews from prudho and y0hami via 48921e0 March 8, 2019 13:50
@ghost
Copy link

ghost commented Mar 8, 2019

There were the following issues with this Pull Request

  • Commit: 140c615
    • ✖ message may not be empty
    • ✖ type may not be empty
  • Commit: 48921e0
    • ✖ message may not be empty
    • ✖ type may not be empty

You may need to change the commit messages to comply with the repository contributing guidelines.


🤖 This comment was generated by commitlint[bot]. Please report issues here.

Happy coding!

Copy link
Member

@y0hami y0hami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@lubber-de lubber-de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y0hami y0hami requested a review from prudho March 8, 2019 15:42
Copy link
Member

@ColinFrick ColinFrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y0hami y0hami merged commit f7c21e9 into fomantic:develop Mar 12, 2019
@y0hami y0hami removed state/awaiting-reviews Pull requests which are waiting for reviews labels Mar 12, 2019
@y0hami y0hami mentioned this pull request Apr 1, 2019
@exoego exoego removed the 🐛 bugfix label May 1, 2019
@exoego exoego added the type/bug Any issue which is a bug or PR which fixes a bug label May 1, 2019
@y0hami
Copy link
Member

y0hami commented Aug 27, 2019

@all-contributors please add @iarspider for code

@allcontributors
Copy link
Contributor

@hammy2899

I've put up a pull request to add @iarspider! 🎉

@lubber-de
Copy link
Member

This fixes Semantic-Org/Semantic-UI#5745

@lubber-de lubber-de added the tag/sui-issue Taken from an existing Issue/PR of SUI label Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript tag/sui-issue Taken from an existing Issue/PR of SUI type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants