Skip to content

Commit

Permalink
Item14266: Merge branch 'Release02x01'
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Jan 16, 2017
2 parents acf8acc + 219bb4d commit dc9eb0e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
Expand Up @@ -791,10 +791,14 @@ $.NatEditor.prototype.hideMessages = function() {
$.NatEditor.prototype.extractErrorMessage = function(text) {
var self = this;

if (text.match(/^<!DOCTYPE/)) {
if (text && text.match(/^<!DOCTYPE/)) {
text = $(text).find(".natErrorMessage").text().replace(/\s+/g, ' ').replace(/^\s+/, '') || '';
}

if (text === "error") {
text = "Error: save failed. Please save your content locally and reload this page.";
}

return text;
};

Expand Down Expand Up @@ -919,7 +923,7 @@ $.NatEditor.prototype.initForm = function() {
});
},
error: function(xhr, textStatus, errorThrown) {
var message = self.extractErrorMessage(xhr.responseText) || textStatus;
var message = self.extractErrorMessage(xhr.responseText || textStatus);
self.showMessage("error", message);
},
complete: function(xhr, textStatus) {
Expand Down Expand Up @@ -969,7 +973,7 @@ $.NatEditor.prototype.initForm = function() {
});
},
error: function(xhr, textStatus, errorThrown) {
var message = self.extractErrorMessage(xhr.responseText) || textStatus;
var message = self.extractErrorMessage(xhr.responseText || textStatus);
$.unblockUI();
self.showMessage("error", message);
},
Expand Down
2 changes: 1 addition & 1 deletion PatternSkin/data/System/WebTopBarExample.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1461197843" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1484554777" format="1.1" version="1"}%
%META:TOPICPARENT{name="PatternSkin"}%
<table border="0" cellpadding="0" cellspacing="0" style="width:100%" summary="">
<tr><td valign="middle"><span id="foswikiLogo" class="foswikiImage"><a href="%WEBLOGOURL%"><img src="%WEBLOGOIMG%" border="0" alt="%WEBLOGOALT%" style="border:none;" /></a></span></td>
Expand Down
2 changes: 1 addition & 1 deletion core/data/System/LanguageSelector.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1460446104" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1484554777" format="1.1" version="1"}%
%META:TOPICPARENT{name="TimeSpecifications"}%
---+!! Language selection dropdown

Expand Down
12 changes: 7 additions & 5 deletions core/lib/Foswiki/Configure/Checkers/LANGUAGE.pm
Expand Up @@ -40,12 +40,14 @@ sub check_current_value {
unless ( -r "$dir/$lang.po" );

# Code taken from Foswki::I18N
my $h = Foswiki::I18N->get_handle($lang);
my $name = eval { $h->maketext("_language_name") };
unless ($name) {
$reporter->ERROR(
if ( Foswiki::I18N->can('get_handle') ) {
my $h = Foswiki::I18N->get_handle($lang);
my $name = eval { $h->maketext("_language_name") };
unless ($name) {
$reporter->ERROR(
"Internal error: $lang is missing the '_language_name' from it's translation. Language will not be usable."
);
);
}
}
}

Expand Down

0 comments on commit dc9eb0e

Please sign in to comment.