stevukas / phpliteadmin

Automatically exported from code.google.com/p/phpliteadmin
0 stars 0 forks source link

Export & Import does not work for the first DB #195

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This bug has been sent to me by Lonnie (via mail because Lonnie does not have a 
google account). Thanks, Lonnie!

What steps will reproduce the problem?
1. Open the first DB in the list
2. Click "Export"
3. "Export" (e.g. as SQL)

What is the expected output? What do you see instead?
Expected: DB Dump
Actual output (in the export-file):
<div class='confirm' style='margin:20px;'>The database, '', does not exist and 
cannot be created because the containing directory, '', is not writable. The 
application is unusable until you make it writable.<form 
action='phpliteadmin.php' method='post'><input type='submit' value='Log Out' 
name='Logout' class='btn'/></form></div><br/>

Lonnie also found the problem ("After much hair-pulling") and sent a solution:
The problem is that isManagedDB can return a key value of 0, so an exact match 
of === false is needed.

His patch:
--
@@ -1864,7 +1864,7 @@
        sort($databases);
    }
    // we now have the $databases array set. Check whethet currentDB is a managed Db (is in this array)
-   if(isset($_SESSION[COOKIENAME.'currentDB']) && 
!isManagedDB($_SESSION[COOKIENAME.'currentDB']['path']))
+   if(isset($_SESSION[COOKIENAME.'currentDB']) && 
isManagedDB($_SESSION[COOKIENAME.'currentDB']['path'])===false)
        unset($_SESSION[COOKIENAME.'currentDB']);

    //user is deleting a database
--

I can reproduce the problem and confirm that the problem found is correct and 
the patch is good.

This bug has been introduced in 1.9.4 with r350 while fixing issue #188.

As this breaks a feature that is quite important, I am considering a regression 
update. Especially because we plan major changes for 1.9.5 and therefore the 
work on 1.9.5 might take some time.
But maybe let's wait a couple of days to see if more bugs come up.

Original issue reported on code.google.com by crazy4ch...@gmail.com on 19 Mar 2013 at 9:30

GoogleCodeExporter commented 9 years ago
I just applied this patch to what is currently in svn as 1.9.5.
I consider releasing this as 1.9.4.1 as a regression update.  

Original comment by crazy4ch...@gmail.com on 19 Mar 2013 at 9:37

GoogleCodeExporter commented 9 years ago
btw: as this bug only affects the first db in the list, you can create a new 
empty db in front of the first db as a quick workaround.

Original comment by crazy4ch...@gmail.com on 19 Mar 2013 at 10:03

GoogleCodeExporter commented 9 years ago

Original comment by crazy4ch...@gmail.com on 20 Mar 2013 at 7:26

GoogleCodeExporter commented 9 years ago
This is fixed in what is in svn under "1.9.4.1" and "1.9.5".

Original comment by crazy4ch...@gmail.com on 22 Mar 2013 at 5:12