summaryrefslogtreecommitdiff
path: root/pgv_to_wt.php
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-07-29 21:50:03 +0000
committerfisharebest <fisharebest@gmail.com>2010-07-29 21:50:03 +0000
commitc61f9d452d071516baebc33eb17897d81f5c9427 (patch)
tree8a22e54f680c35c30d74e5aa31c43ad4dab74c68 /pgv_to_wt.php
parent173420f87327d267cbdafae9c948f693edd3bd0b (diff)
downloadwebtrees-c61f9d452d071516baebc33eb17897d81f5c9427.tar.gz
webtrees-c61f9d452d071516baebc33eb17897d81f5c9427.tar.bz2
webtrees-c61f9d452d071516baebc33eb17897d81f5c9427.zip
pgv-wt wizard - don't fail if fav/news modules are disabled
Diffstat (limited to 'pgv_to_wt.php')
-rw-r--r--pgv_to_wt.php26
1 files changed, 17 insertions, 9 deletions
diff --git a/pgv_to_wt.php b/pgv_to_wt.php
index e3b248265c..260bc9ad24 100644
--- a/pgv_to_wt.php
+++ b/pgv_to_wt.php
@@ -664,18 +664,26 @@ WT_DB::prepare(
////////////////////////////////////////////////////////////////////////////////
echo '<p>pgv_favorites => wt_favorites ...</p>'; flush();
-WT_DB::prepare(
- "REPLACE INTO `##favorites` (fv_id, fv_username, fv_gid, fv_type, fv_file, fv_url, fv_title, fv_note)".
- " SELECT fv_id, fv_username, fv_gid, fv_type, fv_file, fv_url, fv_title, fv_note FROM {$DBNAME}.{$TBLPREFIX}favorites"
-)->execute();
+try {
+ WT_DB::prepare(
+ "REPLACE INTO `##favorites` (fv_id, fv_username, fv_gid, fv_type, fv_file, fv_url, fv_title, fv_note)".
+ " SELECT fv_id, fv_username, fv_gid, fv_type, fv_file, fv_url, fv_title, fv_note FROM {$DBNAME}.{$TBLPREFIX}favorites"
+ )->execute();
+} catch (PDOException $ex) {
+ // This table will only exist if the favorites module is installed in WT
+}
////////////////////////////////////////////////////////////////////////////////
echo '<p>pgv_news => wt_news ...</p>'; flush();
-WT_DB::prepare(
- "REPLACE INTO `##news` (n_id, n_username, n_date, n_title, n_text)".
- " SELECT n_id, n_username, n_date, n_title, n_text FROM {$DBNAME}.{$TBLPREFIX}news"
-)->execute();
+try {
+ WT_DB::prepare(
+ "REPLACE INTO `##news` (n_id, n_username, n_date, n_title, n_text)".
+ " SELECT n_id, n_username, n_date, n_title, n_text FROM {$DBNAME}.{$TBLPREFIX}news"
+ )->execute();
+} catch (PDOException $ex) {
+ // This table will only exist if the news/blog module is installed in WT
+}
////////////////////////////////////////////////////////////////////////////////
@@ -760,7 +768,7 @@ try {
" SELECT pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom, pl_icon FROM {$DBNAME}.{$TBLPREFIX}placelocation"
)->execute();
} catch (PDOexception $ex) {
- // This table will only exist if the gm module is installed in PGV
+ // This table will only exist if the gm module is installed in PGV/WT
}
////////////////////////////////////////////////////////////////////////////////