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

Change subject: Fix: cargoRecreateData.php crash after the template is deleted 
by the user
......................................................................

Fix: cargoRecreateData.php crash after the template is deleted by the user

Change-Id: Ieb91d916bfaec5c45c687719a9abdeb9ec4eb9d4
---
M maintenance/cargoRecreateData.php
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/maintenance/cargoRecreateData.php 
b/maintenance/cargoRecreateData.php
index bb1aa09..ca04fec 100644
--- a/maintenance/cargoRecreateData.php
+++ b/maintenance/cargoRecreateData.php
@@ -112,6 +112,11 @@
 
                foreach( $templatesForThisTable as $templatePageID ) {
                        $templateTitle = Title::newFromID( $templatePageID );
+                       if( $templateTitle == null ) {
+                               // It is possible that the Template to which 
the table is associated, is now deleted by the user
+                               print "Template (Template Page ID = 
$templatePageID) does not exist, cannot recreate data corresponding to this 
template\n";
+                               continue;
+                       }
                        if ( !$quiet ) {
                                print "Handling template that adds to this 
table: " . $templateTitle->getText() . "\n";
                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb91d916bfaec5c45c687719a9abdeb9ec4eb9d4
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