From 3a3a26936e61e6c23e2e6659e8a5f8eacaeb2a99 Mon Sep 17 00:00:00 2001 From: "Thomas E. Horner" Date: Fri, 16 Mar 2012 08:29:06 +0100 Subject: [PATCH] added warning messages for easier inconsistency detection --- 3.0/modules/g1_import/helpers/Gallery1DataParser.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/3.0/modules/g1_import/helpers/Gallery1DataParser.php b/3.0/modules/g1_import/helpers/Gallery1DataParser.php index 6aa6acf6..74b1d826 100644 --- a/3.0/modules/g1_import/helpers/Gallery1DataParser.php +++ b/3.0/modules/g1_import/helpers/Gallery1DataParser.php @@ -47,17 +47,24 @@ class Gallery1DataParser { * object Unserialized user metadata */ function loadFile($fileName) { + $fileName = str_replace('//','/',$fileName); if (!file_exists($fileName) || !is_readable($fileName)) { if (file_exists($fileName . '.bak') && is_readable($fileName . '.bak')) { $fileName .= '.bak'; } else { + message::warning( + t('Gallery1 inconsistency: Missing or not readable file %file', + array('file' => $fileName))); return array('ERROR_BAD_PARAMETER', null); } } $tmp = file($fileName); if (empty($tmp)) { + message::warning( + t('Gallery1 inconsistency: Empty file %file', + array('file' => $fileName))); return array('ERROR_MISSING_VALUE', null); }