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

Index creation - Enter key form submission - Fatal JS Error #14611

Closed
sarvap-praharanayuthan opened this issue Sep 9, 2018 · 4 comments · Fixed by #15622
Closed

Index creation - Enter key form submission - Fatal JS Error #14611

sarvap-praharanayuthan opened this issue Sep 9, 2018 · 4 comments · Fixed by #15622
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
Milestone

Comments

@sarvap-praharanayuthan
Copy link

sarvap-praharanayuthan commented Sep 9, 2018

Form submission with "Enter" key throws JavaScript error

While creating indexes for a column, after typing the index name and pressing Enter key instead of pressing the Go button to submit the form throws JavaScript fatal error. Observing this bug from previous versions as well.

To Reproduce

Steps to reproduce the behavior:

  1. Create a table under a database.
  2. Enter a name for the table column and choose a suitable datatype.
  3. Choose any type of index, say Index from Index column.
  4. Type a name for the index and press the Enter key after typing the index name.

Expected behavior

The form gets submitted and the modal gets close.

Screenshots

image

Server configuration

phpMyAdmin demo https://demo.phpmyadmin.net

  • Web server: nginx/1.10.3
  • Database version: 5.0.12-dev
  • PHP version: 7.2.8
  • phpMyAdmin version: 5.0.0
@MauricioFauth MauricioFauth added the Bug A problem or regression with an existing feature label Sep 15, 2018
@MauricioFauth
Copy link
Member

Affects QA_4_8 and master.

@kartik1000
Copy link
Contributor

Hey, @MauricioFauth I was able to reproduce this issue. But I found out that this issue is not being caused in Safari, but is there in Chrome.

@williamdes
Copy link
Member

#15146 Explains why I can not find any reports on the reporting server.

@williamdes williamdes added this to to be fixed soon in issues Apr 29, 2019
@williamdes williamdes added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Dec 6, 2019
williamdes pushed a commit to kartik1000/phpmyadmin that referenced this issue Jan 2, 2020
Fixes phpmyadmin#14611

Signed-off-by: Kartik Kathuria <kathuriakartik0@gmail.com>
williamdes pushed a commit to kartik1000/phpmyadmin that referenced this issue Feb 23, 2020
Fixes phpmyadmin#14611

Signed-off-by: Kartik Kathuria <kathuriakartik0@gmail.com>
@williamdes
Copy link
Member

{
    "pma_version": "5.0.2-dev",
    "browser_name": "CHROME",
    "browser_version": "80.0.3987.87",
    "user_os": "Linux",
    "server_software": "nginx/1.17.8",
    "user_agent_string": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36",
    "locale": "en",
    "configuration_storage": "enabled",
    "php_version": "8.0.0-dev",
    "script_name": "tbl_structure.php",
    "exception_type": "js",
    "exception": {
        "mode": "stack",
        "name": "Error",
        "message": "cannot call methods on slider prior to initialization; attempted to call method 'value'",
        "stack": [
            {
                "line": "292",
                "func": "",
                "context": [
                    "            if (lastException === ex) {",
                    "                processLastException();",
                    "            }",
                    "        }, (stack.incomplete ? 2000 : 0));",
                    "",
                    "        throw ex; // re-throw to propagate to the top level (and cause wind//...",
                    "    }",
                    "",
                    "    report.subscribe = subscribe;",
                    "    report.unsubscribe = unsubscribe;",
                    "    return report;"
                ],
                "uri": "js/vendor/tracekit.js?v=5.0.2-dev",
                "scriptname": "js/vendor/tracekit.js"
            },
            {
                "func": "Function.error",
                "line": "2",
                "column": "2394",
                "context": [
                    "/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/l//...",
                    "!function(e,t){\"use strict\";\"object\"==typeof module&&\"object\"==typeof modul//...",
                    ""
                ],
                "uri": "js/vendor/jquery/jquery.min.js?v=5.0.2-dev",
                "scriptname": "js/vendor/jquery/jquery.min.js"
            },
            {
                "func": "HTMLDivElement.",
                "line": "6",
                "column": "5615",
                "context": [
                    "/*! jQuery UI - v1.12.1 - 2016-12-18",
                    "* http://jqueryui.com",
                    "* Includes: widget.js, position.js, data.js, disable-selection.js, focusabl//...",
                    "* Copyright jQuery Foundation and other contributors; Licensed MIT */",
                    "",
                    "(function(t){\"function\"==typeof define&&define.amd?define([\"jquery\"],t):t(j//...",
                    "},_convertPositionTo:function(t,e){e||(e=this.position);var i=\"absolute\"===//...",
                    "t(n.alsoResize).each(function(){var e=t(this),s=t(this).data(\"ui-resizable-//...",
                    "},_destroyIcons:function(){this._removeClass(this.headers,\"ui-accordion-ico//...",
                    "},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);//...",
                    "break;case U[1]-1:T+=\" ui-datepicker-group-last\",I=\" ui-corner-\"+(Y?\"left\"://..."
                ],
                "uri": "js/vendor/jquery/jquery-ui.min.js?v=5.0.2-dev",
                "scriptname": "js/vendor/jquery/jquery-ui.min.js"
            },
            {
                "func": "Function.each",
                "line": "2",
                "column": "2777",
                "context": [
                    "/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/l//...",
                    "!function(e,t){\"use strict\";\"object\"==typeof module&&\"object\"==typeof modul//...",
                    ""
                ],
                "uri": "js/vendor/jquery/jquery.min.js?v=5.0.2-dev",
                "scriptname": "js/vendor/jquery/jquery.min.js"
            },
            {
                "func": "jQuery.fn.init.each",
                "line": "2",
                "column": "1419",
                "context": [
                    "/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/l//...",
                    "!function(e,t){\"use strict\";\"object\"==typeof module&&\"object\"==typeof modul//...",
                    ""
                ],
                "uri": "js/vendor/jquery/jquery.min.js?v=5.0.2-dev",
                "scriptname": "js/vendor/jquery/jquery.min.js"
            },
            {
                "func": "jQuery.fn.init.t.fn. [as slider]",
                "line": "6",
                "column": "5357",
                "context": [
                    "/*! jQuery UI - v1.12.1 - 2016-12-18",
                    "* http://jqueryui.com",
                    "* Includes: widget.js, position.js, data.js, disable-selection.js, focusabl//...",
                    "* Copyright jQuery Foundation and other contributors; Licensed MIT */",
                    "",
                    "(function(t){\"function\"==typeof define&&define.amd?define([\"jquery\"],t):t(j//...",
                    "},_convertPositionTo:function(t,e){e||(e=this.position);var i=\"absolute\"===//...",
                    "t(n.alsoResize).each(function(){var e=t(this),s=t(this).data(\"ui-resizable-//...",
                    "},_destroyIcons:function(){this._removeClass(this.headers,\"ui-accordion-ico//...",
                    "},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);//...",
                    "break;case U[1]-1:T+=\" ui-datepicker-group-last\",I=\" ui-corner-\"+(Y?\"left\"://..."
                ],
                "uri": "js/vendor/jquery/jquery-ui.min.js?v=5.0.2-dev",
                "scriptname": "js/vendor/jquery/jquery-ui.min.js"
            },
            {
                "func": "HTMLInputElement.",
                "line": "3747",
                "column": "14",
                "context": [
                    "    $(document).on('click', '#index_frm input[type=submit]', function (event) {",
                    "        event.preventDefault();",
                    "        var rowsToAdd = $(this)",
                    "            .closest('fieldset')",
                    "            .find('.slider')",
                    "            .slider('value');",
                    "",
                    "        var tempEmptyVal = function () {",
                    "            $(this).val('');",
                    "        };",
                    ""
                ],
                "uri": "js/functions.js?v=5.0.2-dev",
                "scriptname": "js/functions.js"
            },
            {
                "func": "HTMLInputElement.newFunc",
                "line": "267",
                "column": "33",
                "context": [
                    "     */",
                    "    wrapFunction: function (func) {",
                    "        if (!func.wrapped) {",
                    "            var newFunc = function () {",
                    "                try {",
                    "                    return func.apply(this, arguments);",
                    "                } catch (x) {",
                    "                    TraceKit.report(x);",
                    "                }",
                    "            };",
                    "            newFunc.wrapped = true;"
                ],
                "uri": "js/error_report.js?v=5.0.2-dev",
                "scriptname": "js/error_report.js"
            },
            {
                "func": "HTMLDocument.dispatch",
                "line": "2",
                "column": "42571",
                "context": [
                    "/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/l//...",
                    "!function(e,t){\"use strict\";\"object\"==typeof module&&\"object\"==typeof modul//...",
                    ""
                ],
                "uri": "js/vendor/jquery/jquery.min.js?v=5.0.2-dev",
                "scriptname": "js/vendor/jquery/jquery.min.js"
            },
            {
                "func": "HTMLDocument.$event.dispatch",
                "line": "374",
                "column": "19",
                "context": [
                    "$event.dispatch = function( event ){",
                    "\tif ( $.data( this, \"suppress.\"+ event.type ) - new Date().getTime() > 0 ){",
                    "\t\t$.removeData( this, \"suppress.\"+ event.type );",
                    "\t\treturn;",
                    "\t}",
                    "\treturn $dispatch.apply( this, arguments );",
                    "};",
                    "",
                    "// event fix hooks for touch events...",
                    "var touchHooks = ",
                    "$event.fixHooks.touchstart = "
                ],
                "uri": "js/vendor/jquery/jquery.event.drag-2.2.js?v=5.0.2-dev",
                "scriptname": "js/vendor/jquery/jquery.event.drag-2.2.js"
            },
            {
                "func": "HTMLDocument.v.handle",
                "line": "2",
                "column": "40572",
                "context": [
                    "/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/l//...",
                    "!function(e,t){\"use strict\";\"object\"==typeof module&&\"object\"==typeof modul//...",
                    ""
                ],
                "uri": "js/vendor/jquery/jquery.min.js?v=5.0.2-dev",
                "scriptname": "js/vendor/jquery/jquery.min.js"
            }
        ],
        "incomplete": "false",
        "partial": "true",
        "uri": "tbl_structure.php?"
    }
}

I added a check that the slider is used to prevent a crash https://github.com/phpmyadmin/phpmyadmin/pull/15622/files

@williamdes williamdes linked a pull request Feb 23, 2020 that will close this issue
6 tasks
@williamdes williamdes self-assigned this Apr 26, 2020
@williamdes williamdes added this to the 5.0.3 milestone Apr 26, 2020
williamdes added a commit that referenced this issue Apr 26, 2020
…n - Fatal JS Error

Pull-request: #15622
Fixes: #14611

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Apr 26, 2020
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from to be fixed soon to Closed Apr 26, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
issues
  
Closed
Development

Successfully merging a pull request may close this issue.

4 participants