Fix for bug #2484911 about empty query when editing it from a Select page.
authorGuillaume (ioguix) de Rorthais <ioguix@free.fr>
Fri, 30 Jan 2009 04:16:54 +0000 (23:16 -0500)
committerGuillaume (ioguix) de Rorthais <ioguix@free.fr>
Fri, 30 Jan 2009 04:16:54 +0000 (23:16 -0500)
classes/Misc.php
database.php
display.php

index 172c40574f0f29b912f69c857d5aabb11e5417ec..d048949ec546c3ca1fd1c0f47482900a927c7809 100644 (file)
                                                'sql' => array (
                                                        'title' => $lang['strsql'],
                                                        'url'   => 'database.php',
-                                                       'urlvars' => array('subject' => 'database', 'action' => 'sql'),
+                                                       'urlvars' => array('subject' => 'database', 'action' => 'sql', 'new' => 1),
                                                        'help'  => 'pg.sql',
                                                        'tree'  => false,
                                                        'icon'  => 'SqlEditor'
index dfccf2cd506e5992c06d19ac688987b317c57690..c730a0ad1b1a4f6e3c6ba778f6ac4f3a312f9a37 100755 (executable)
                global $data, $misc;
                global $lang;
 
-               if (!isset($_SESSION['sqlquery'])) $_SESSION['sqlquery'] = '';
+               if ((!isset($_SESSION['sqlquery'])) || isset($_REQUEST['new'])) $_SESSION['sqlquery'] = '';
 
                $misc->printTrail('database');
                $misc->printTabs('database','sql');
index 60971b7efe9bbd27876a83434d1b34132b517ba7..f38360ec99a3877836644e6c88fb3fb447829e1b 100644 (file)
         */
        function doBrowse($msg = '') {
                global $data, $conf, $misc, $lang;
-               
+
                $save_history = false;
                // If current page is not set, default to first page
                if (!isset($_REQUEST['page']))
                else {
                        $subject = '';
                }
-       
+
                $misc->printTrail(isset($subject) ? $subject : 'database');
                
                if (isset($object)) {
                        if (isset($_REQUEST['query'])) {
+                               $_SESSION['sqlquery'] = $_REQUEST['query'];
                                $misc->printTitle($lang['strselect']);
                                $type = 'SELECT';
                        } else {
 
                // If 'sortkey' is not set, default to ''
                if (!isset($_REQUEST['sortkey'])) $_REQUEST['sortkey'] = '';
-       
+
                // If 'sortdir' is not set, default to ''
                if (!isset($_REQUEST['sortdir'])) $_REQUEST['sortdir'] = '';