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

Submitting search form (mini) with empty value throws error on preventDefault #13791

Closed
koenner01 opened this issue Feb 22, 2018 · 3 comments
Closed
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@koenner01
Copy link
Contributor

Preconditions

  1. PHP 7.0
  2. CE 2.2.x (also tested in 2.1.11)

Steps to reproduce

  1. Submit search form in header with no value

Expected result

  1. Nothing should happen

Actual result

  1. A javascript error is throw: Cannot read property 'preventDefault' of undefined

The _onSubmit function in module-search/view/frontend/web/form-mini.js supports parameter e (for the event), but the proxy function being defined in the _create does not pass the event to the function

this.searchForm.on('submit', $.proxy(function() {
    this._onSubmit();
    this._updateAriaHasPopup(false);
}, this));
_onSubmit: function (e) {
    var value = this.element.val();

    if (isEmpty(value)) {
        e.preventDefault();
    }

    if (this.responseList.selected) {
        this.element.val(this.responseList.selected.find('.qs-option-name').text());
    }
},
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Feb 22, 2018
@magento-engcom-team
Copy link
Contributor

@koenner01, thank you for your report.
We've acknowledged the issue and added to our backlog.

@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Feb 22, 2018
@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Feb 27, 2018
@magento-engcom-team
Copy link
Contributor

Hi @koenner01. Thank you for your report.
The issue has been fixed in #13811 by @koenner01 in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.4 release.

@magento-engcom-team
Copy link
Contributor

Hi @koenner01. Thank you for your report.
The issue has been fixed in #14185 by @dimonovp in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

2 participants