]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Fixed bug with fetchmode in bweb.inc.php
authorDavide Franco <bacula-dev@dflc.ch>
Tue, 7 Dec 2010 11:01:13 +0000 (12:01 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:31 +0000 (14:43 +0200)
gui/bacula-web/bweb.inc.php

index 4c968212f72186eb9cfecba6e28dc3140543fcfd..248207748de2c690f1481cacb84c4bb6ffdc05c2 100644 (file)
@@ -254,13 +254,13 @@ class Bweb extends DB {
                                // Get the list of pools id
                                $query = "SELECT Pool.poolid, Pool.name FROM Pool ORDER BY Pool.poolid";
                                
-                               $this->db_link->setFetchMode(DB_FETCHMODE_ASSOC);
+                               //$this->db_link->setFetchMode(DB_FETCHMODE_ASSOC);
                                $pools = $this->db_link->query( $query );
                                
                                if( PEAR::isError( $pools ) )
                                        die("Error: Failed to get pool list <br />SQL Query: $query<br />" . $pools->getMessage() );
                                
-                               while( $pool = $pools->fetchRow() ) {
+                               while( $pool = $pools->fetchRow( DB_FETCHMODE_ASSOC ) ) {
                                        switch( $this->driver )
                                        {
                                                case 'mysql':
@@ -290,7 +290,7 @@ class Bweb extends DB {
                                                break;
                                        } // end switch
                                        
-                                       $this->db_link->setFetchMode(DB_FETCHMODE_ASSOC);
+                                       //$this->db_link->setFetchMode(DB_FETCHMODE_ASSOC);
                                        $medias = $this->db_link->query( $query );
 
                                        if( PEAR::isError( $medias ) ) {
@@ -303,7 +303,7 @@ class Bweb extends DB {
                                                {
                                                        $volumes[ $pool['name'] ] = array();
                                                }
-                                               while( $media = $medias->fetchRow() ) {
+                                               while( $media = $medias->fetchRow( DB_FETCHMODE_ASSOC ) ) {
                                                        if( $debug ) {
                                                                var_dump( $media );
                                                        }
@@ -554,7 +554,7 @@ class Bweb extends DB {
                                if( PEAR::isError( $result ) ) {
                                        die("Unable to get volume number from catalog");
                                }else{
-                                       $nb_vol = $result->fetchRow();
+                                       $nb_vol = $result->fetchRow(DB_FETCHMODE_ASSOC);
                                        return array( $pool_name, $nb_vol['nb_vol'] );
                                }
                        }