Fix display of data dir in migration error message
When migrating prefs from Zotero for Firefox, the prefs specified a custom data dir, and that directory was missing, the "Previous directory:" line was blank.
This commit is contained in:
parent
9395af86f7
commit
18c62be6a4
|
@ -300,6 +300,9 @@ Zotero.DataDirectory = {
|
||||||
// access the custom location in Firefox, use the Zotero profile, since
|
// access the custom location in Firefox, use the Zotero profile, since
|
||||||
// there's at least some chance it's right. Otherwise, throw an error.
|
// there's at least some chance it's right. Otherwise, throw an error.
|
||||||
if (!useProfile) {
|
if (!useProfile) {
|
||||||
|
// The error message normally gets the path from the pref, but
|
||||||
|
// we got it from the prefs file, so include it here
|
||||||
|
e.dataDir = nsIFile.path;
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,7 +313,9 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
Zotero.logError(e);
|
Zotero.logError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
let previousDir = Zotero.Prefs.get('lastDataDir') || Zotero.Prefs.get('dataDir');
|
let previousDir = Zotero.Prefs.get('lastDataDir')
|
||||||
|
|| Zotero.Prefs.get('dataDir')
|
||||||
|
|| e.dataDir;
|
||||||
Zotero.startupError = foundInDefault
|
Zotero.startupError = foundInDefault
|
||||||
? Zotero.getString(
|
? Zotero.getString(
|
||||||
'dataDir.notFound.defaultFound',
|
'dataDir.notFound.defaultFound',
|
||||||
|
@ -357,8 +359,10 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
else {
|
else {
|
||||||
let index = ps.confirmEx(null,
|
let index = ps.confirmEx(null,
|
||||||
Zotero.getString('general.error'),
|
Zotero.getString('general.error'),
|
||||||
Zotero.startupError + '\n\n' +
|
Zotero.startupError
|
||||||
Zotero.getString('dataDir.previousDir') + ' ' + previousDir,
|
+ (previousDir
|
||||||
|
? '\n\n' + Zotero.getString('dataDir.previousDir') + ' ' + previousDir
|
||||||
|
: ''),
|
||||||
buttonFlags,
|
buttonFlags,
|
||||||
Zotero.getString('general.quit'),
|
Zotero.getString('general.quit'),
|
||||||
Zotero.getString('dataDir.useDefaultLocation'),
|
Zotero.getString('dataDir.useDefaultLocation'),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user