Return link after renaming table goes to database page

Issue #230 resolved
Former user created an issue

Originally reported on Google Code with ID 230

1. Choose a table
2. Choose tab "table_rename"
3. Set another name
4. Below the confirmation message there's a return link. Click it.

Instead of going to "row_view" of that table, phpliteadmin goes to database page.

To fix it, I propose using something like

    //user has performed some action so show the resulting message
    if(isset($_GET['confirm']))
    {
        echo "<div id='main'>";
        echo "<div class='confirm'>";
        if(isset($error) && $error) //an error occured during the action, so show an error
message
            echo $lang['err'].": ".$db->getError().".<br/>".$lang['bug_report'].' '.PROJECT_BUGTRACKER_LINK;
        else //action was performed successfully - show success message
            echo $completed;
        echo "</div><br/><br/>";
        if($_GET['action']=="row_delete" || $_GET['action']=="row_create" || $_GET['action']=="row_edit")
            echo "<a href='".PAGE."?table=".urlencode($_GET['table'])."&amp;action=row_view'>".$lang['return']."</a>";
        else if($_GET['action']=="column_create" || $_GET['action']=="column_delete" || $_GET['action']=="column_edit"
|| $_GET['action']=="index_create" || $_GET['action']=="index_delete" || $_GET['action']=="trigger_delete"
|| $_GET['action']=="trigger_create")
            echo "<a href='".PAGE."?table=".urlencode($_GET['table'])."&amp;action=column_view'>".$lang['return']."</a>";
        else if($_GET['action']==="table_rename")
            echo "<a href='".PAGE."?table=".urlencode($_POST['newname'])."&amp;action=row_view'>".$lang['return']."</a>";
        else
            echo "<a href='".PAGE."'>".$lang['return']."</a>";
        echo "</div>";
    }

instead of

    //user has performed some action so show the resulting message
    if(isset($_GET['confirm']))
    {
        echo "<div id='main'>";
        echo "<div class='confirm'>";
        if(isset($error) && $error) //an error occured during the action, so show an error
message
            echo $lang['err'].": ".$db->getError().".<br/>".$lang['bug_report'].' '.PROJECT_BUGTRACKER_LINK;
        else //action was performed successfully - show success message
            echo $completed;
        echo "</div>";
        if($_GET['action']=="row_delete" || $_GET['action']=="row_create" || $_GET['action']=="row_edit")
            echo "<br/><br/><a href='".PAGE."?table=".urlencode($_GET['table'])."&amp;action=row_view'>".$lang['return']."</a>";
        else if($_GET['action']=="column_create" || $_GET['action']=="column_delete" || $_GET['action']=="column_edit"
|| $_GET['action']=="index_create" || $_GET['action']=="index_delete" || $_GET['action']=="trigger_delete"
|| $_GET['action']=="trigger_create")
            echo "<br/><br/><a href='".PAGE."?table=".urlencode($_GET['table'])."&amp;action=column_view'>".$lang['return']."</a>";
        else
            echo "<br/><br/><a href='".PAGE."'>".$lang['return']."</a>";
        echo "</div>";
    }


I am using
* phpLiteAdmin v1.9.4.1 
* PHP 5.4.17
* PDO
* SQLite version 3.7.7.1
* Apache 2.4.6
* Windows XP SP3

Reported by Loirooriol on 2013-08-30 18:52:10

Comments (2)

  1. Christopher Kramer
    Problem with this is that there are multiple ways from where you can get there. You
    can also get to the table_rename action from the database page. And in this case, you'd
    also expect to get back to the db page when clicking "Return".
    So I guess we'd need to differ between these two cases.
    

    Reported by crazy4chrissi on 2013-12-24 13:33:54 - Status changed: Accepted - Labels added: Type-Enhancement - Labels removed: Type-Defect

  2. Christopher Kramer
    We now go back to the row_view action as of r444, so I consider this one as fixed.
    

    Reported by crazy4chrissi on 2013-12-29 23:22:59 - Status changed: Fixed - Labels added: Target-1.9.5

  3. Log in to comment