Fz-29 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/361287 )

Change subject: Fix: Drilldown crash after user deletes tables from Database
......................................................................

Fix: Drilldown crash after user deletes tables from Database

Change-Id: I7896e856c7341be2b46b7f188bd4a51f32fc888f
---
M drilldown/CargoSpecialDrilldown.php
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/87/361287/1

diff --git a/drilldown/CargoSpecialDrilldown.php 
b/drilldown/CargoSpecialDrilldown.php
index 9e887fa..b5bf472 100644
--- a/drilldown/CargoSpecialDrilldown.php
+++ b/drilldown/CargoSpecialDrilldown.php
@@ -294,9 +294,15 @@
                }
                $cdb = CargoUtils::getDB();
                foreach ( $tables as $table ) {
-                       $res = $cdb->select( $table, 'COUNT(*) AS total' );
-                       $row = $cdb->fetchRow( $res );
-                       $tableRows = $row['total'];
+                       try {
+                               $res = $cdb->select( $table, 'COUNT(*) AS 
total' );
+                               $row = $cdb->fetchRow( $res );
+                               $tableRows = $row['total'];
+                       } catch ( Exception $e ) {
+                               // Probably the table does not exist due to 
deletion by the user (or other reasons)
+                               continue;
+                       }
+                       
                        $tableStr = $this->displayTableName( $table ) . " 
($tableRows)";
                        if ( $this->tableName == $table ) {
                                $text .= '                                      
        <li class="tableName selected">';

-- 
To view, visit https://gerrit.wikimedia.org/r/361287
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7896e856c7341be2b46b7f188bd4a51f32fc888f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Fz-29 <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to