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

Javascript error when renaming table #10846

Closed
pma-import opened this issue Jun 3, 2014 · 12 comments
Closed

Javascript error when renaming table #10846

pma-import opened this issue Jun 3, 2014 · 12 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
Projects
Milestone

Comments

@pma-import
Copy link

pma-import commented Jun 3, 2014

Go to a table, then to the Operations tab.
Type a new name in the "Rename table to" box and click Go.
A Javascript error appears (the table is renamed fine, however).
There was also an error sending the error report, so here's the details:

"exception": {
    "mode": "onerror",
    "message": "Uncaught TypeError: Cannot read property 'substring' of undefined",
    "stack": [
        {
            "line": 151,
            "func": "refreshMain",
            "context": [
                "     * @return void",
                "     */",
                "    refreshMain: function (url, callback) {",
                "        if (! url) {",
                "            url = $('#selflink a').attr('href');",
                "            url = url.substring(0, url.indexOf('?'));",
                "        }",
                "        url += PMA_commonParams.getUrlQuery();",
                "        $('', {href: url})",
                "            .appendTo('body')",
                "            .click()"
            ],
            "filename": "common.js"
        }
    ],
    "useragent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36",
    "name": "TypeError",
    "uri": "tbl_operations.php?target="
},
"script_name": "tbl_operations.php",
"pma_version": "4.2.2",
"browser_name": "CHROME",
"browser_version": "35.0.1916.114",
"user_os": "Mac",
"server_software": "Apache/2.2.26 (Unix) DAV/2 PHP/5.4.24 mod_ssl/2.2.26 OpenSSL/0.9.8y",
"user_agent_string": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36",
"locale": "en",
"configuration_storage": "enabled",
"php_version": "5.4.24",

I'm using PMA from Github (STABLE branch).


@pma-import
Copy link
Author

I am unable to reproduce this bug with version 4.2.2. Are you getting this error every time you try to rename a table?


  • Original author: madhuracj

@pma-import
Copy link
Author

  • status: open --> pending

  • Original author: madhuracj

@pma-import
Copy link
Author

Strange, I am not getting a Javascript error now. Maybe there was something else that was causing the issue.


  • Original author: svivian

@pma-import
Copy link
Author

  • status: pending --> works-for-me

  • Original author: madhuracj

@pma-import
Copy link
Author

Looking at the exception it looks like the 'selflink' that appears at the bottom of each page was missing in the rename page (probably due to some other error). Exception when renaming is the side effect.

Anyway, thanks for reporting this. Closing for now.


  • Original author: madhuracj

@pma-import
Copy link
Author

OK I checked into this further and have found the issue.

It's the "open new phpmyadmin window" link as you said. The link disappears under these circumstances:

  1. Browse a table.
  2. Click "Edit" under the query box to open the query pop-up window.
  3. Click SQL history tab.
  4. Click any query link.

What happens is a new tab is opened, rather than running the query in the tab from which the pop-up window was opened. That new tab for some reason doesn't have that 'selflink'.

Incidentally, I commented about this before: https://sourceforge.net/p/phpmyadmin/bugs/4229/#7aca

So I suppose the bug is that the link is missing when a new PMA window is opened. However, the JavaScript ought to be coded to avoid this too - if $('#selflink a').attr('href') is null, don't try to run substring on it!


  • Original author: svivian

@pma-import
Copy link
Author

Another instance this situation occurs: click "Import" and then import anything into a table. The selflink disappears again.

Why exactly was this closed? It's still a bug. Even if this is a side-effect of another bug, I don't see a separate ticket for that bug (the selflink disappearing).


  • Original author: svivian

@pma-import
Copy link
Author

  • status: works-for-me --> open

  • Original author: atul5

@pma-import
Copy link
Author

  • summary: Javascript error when renaming table --> (ok 4.2.6) Javascript error when renaming table
  • status: open --> resolved
  • assigned_to: Atul Pratap Singh
  • Priority: 5 --> 1

  • Original author: atul5

@pma-import
Copy link
Author

Fixed with 2e76e83


  • Original author: atul5

@pma-import
Copy link
Author

  • Status: resolved --> fixed

  • Original author: lem9

@pma-import pma-import added the Bug A problem or regression with an existing feature label Jul 24, 2015
@pma-import pma-import added this to the 4.2.6 milestone Jul 24, 2015
xgin added a commit to xgin/phpmyadmin that referenced this issue May 21, 2019
…ndefined

Signed-off-by: Eugene Kazakov <ekazakov@plesk.com>
xgin added a commit to xgin/phpmyadmin that referenced this issue May 21, 2019
…ndefined

Signed-off-by: Eugene Kazakov <ekazakov@plesk.com>
xgin added a commit to xgin/phpmyadmin that referenced this issue May 22, 2019
…ndefined

Signed-off-by: Eugene Kazakov <ekazakov@plesk.com>
xgin added a commit to xgin/phpmyadmin that referenced this issue May 22, 2019
…ndefined

Signed-off-by: Eugene Kazakov <ekazakov@plesk.com>
@williamdes williamdes assigned williamdes and unassigned atul516 May 27, 2019
@williamdes
Copy link
Member

Param Value
Error Type TypeError
Error Message Cannot read property 'substring' of undefined
Exception Type js
phpMyAdmin version 4.8.6-dev
Incident count 3
Link Report#58011

This comment is posted automatically by phpMyAdmin's error-reporting-server.

xgin added a commit to xgin/phpmyadmin that referenced this issue May 31, 2019
…ndefined

Signed-off-by: Eugene Kazakov <ekazakov@plesk.com>
@williamdes williamdes reopened this May 31, 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 May 31, 2019
@williamdes williamdes added this to Needs triage in issues via automation Jun 3, 2019
@williamdes williamdes moved this from Needs triage to ready to merge in issues Jun 3, 2019
williamdes added a commit that referenced this issue Jun 3, 2019
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes williamdes modified the milestones: 4.2.6, 4.8.6 Jun 3, 2019
issues automation moved this from ready to merge to Closed Jun 3, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 22, 2020
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