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

Cannot read property 'style' of null #16888

Closed
williamdes opened this issue May 7, 2021 · 2 comments
Closed

Cannot read property 'style' of null #16888

williamdes opened this issue May 7, 2021 · 2 comments
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
Milestone

Comments

@williamdes
Copy link
Member

Describe the bug

{
    "pma_version": "5.1.1-dev",
    "browser_name": "CHROME",
    "browser_version": "90.0.4430.93",
    "user_os": "Linux",
    "server_software": "nginx/1.18.0",
    "user_agent_string": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36",
    "locale": "fr",
    "configuration_storage": "disabled",
    "php_version": "7.4.15",
    "script_name": "index.php",
    "exception_type": "js",
    "exception": {
        "mode": "stack",
        "name": "TypeError",
        "message": "Cannot read property 'style' of null",
        "stack": [
            {
                "func": "?",
                "line": "164",
                "column": "13",
                "context": [
                    "    DesignerMove.markSaved();",
                    "",
                    "    for (var t = 0; t < tblCords.length; t++) {",
                    "      var tbId = db + '.' + tblCords[t].tableName;",
                    "      var table = document.getElementById(tbId);",
                    "      table.style.top = tblCords[t].y + 'px';",
                    "      table.style.left = tblCords[t].x + 'px';",
                    "      var checkbox = document.getElementById('check_vis_' + tbId);",
                    "      checkbox.checked = true;",
                    "      DesignerMove.visibleTab(checkbox, checkbox.value);",
                    "    }"
                ],
                "uri": "js/dist/designer/page.js?v=5.1.1-dev",
                "scriptname": "js/dist/designer/page.js"
            },
            {
                "func": "?",
                "line": "186",
                "column": "13",
                "context": [
                    "      DesignerOfflineDB.loadObject('table_coords', page.tblCords[i], functi//...",
                    "        tblCords.push(tblCord);",
                    "",
                    "        if (tblCords.length === count) {",
                    "          if (typeof callback !== 'undefined') {",
                    "            callback(page, tblCords);",
                    "          }",
                    "        }",
                    "      });",
                    "    }",
                    "  });"
                ],
                "uri": "js/dist/designer/page.js?v=5.1.1-dev",
                "scriptname": "js/dist/designer/page.js"
            },
            {
                "func": "IDBRequest.cursorRequest.onsuccess",
                "line": "58",
                "column": "7",
                "context": [
                    "    var transaction = db.transaction([table], 'readwrite');",
                    "    var objStore = transaction.objectStore(table);",
                    "    var cursorRequest = objStore.get(parseInt(id));",
                    "",
                    "    cursorRequest.onsuccess = function (e) {",
                    "      callback(e.target.result);",
                    "    };",
                    "",
                    "    cursorRequest.onerror = designerDB.onerror;",
                    "  };",
                    ""
                ],
                "uri": "js/dist/designer/database.js?v=5.1.1-dev",
                "scriptname": "js/dist/designer/database.js"
            }
        ],
        "uri": "index.php?route=%2Fdatabase%2Fdesigner"
    }
}

To Reproduce

Steps to reproduce the behavior:

  1. Go to Designer

Expected behavior

No error

Server configuration

  • phpMyAdmin version: 5.1
@williamdes williamdes added the Bug A problem or regression with an existing feature label May 7, 2021
@williamdes williamdes added this to the 5.1.1 milestone May 7, 2021
@williamdes williamdes self-assigned this May 7, 2021
@williamdes williamdes added this to Needs triage in issues via automation May 7, 2021
@williamdes williamdes added this to To Do in Designer May 7, 2021
@williamdes williamdes moved this from Needs triage to Reproduced in issues May 7, 2021
@williamdes
Copy link
Member Author

I think this is because I load the page that was saved but I renamed a table in the mean time

@shucon
Copy link
Contributor

shucon commented May 9, 2021

I think this is because I load the page that was saved but I renamed a table in the mean time

I was able to reproduce this issue by saving a page and then renaming a table.

shucon added a commit to shucon/phpmyadmin that referenced this issue May 9, 2021
…page

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
@williamdes williamdes moved this from To Do to In Progress in Designer May 9, 2021
@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 May 9, 2021
@williamdes williamdes moved this from In Progress to Done in Designer May 28, 2021
@williamdes williamdes moved this from Reproduced to ready to merge in issues May 28, 2021
MauricioFauth added a commit that referenced this issue May 28, 2021
Fix #16888 - JS error on renaming tables in saved Designer page
@MauricioFauth MauricioFauth self-assigned this May 28, 2021
MauricioFauth added a commit that referenced this issue May 28, 2021
[ci skip]

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
issues automation moved this from ready to merge to Closed May 28, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2022
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

No branches or pull requests

3 participants