Item11798: Save/Cancel on Edit Topic Settings dialog fails with an error for non-English localizated sites.
Priority: Urgent
Current State: Closed
Released In: 1.1.6
Target Release: patch
Updating to Foswiki 1.1.5 causes an error while saving the topic preferences
The system requires the formfield action_save with value="Save". Within localized foswiki systems in German, the value is getting "Speichern" due to the
MAKETEXT function.
The Workaround is hacking the UI::Manage.pm arround lines 471 .. 481 to avoid checking the action_save and action_cancel values.
--
AlexanderStoffers - 26 Apr 2012
The real fix for this is to rework the Settings screen to not POST for cancel in the first place, so we don't need all these hoops to avoid save when not intended.
Cancel should return to view, with a resetlocks option to clear locks set by the edit. If we don't intend to save, we really should not post to a save script.
--
GeorgeClark - 26 Apr 2012
imo cancel should not be a POST at all. it should be a simple GET link that is css rendered to look like a button.
--
SvenDowideit - 27 Apr 2012
it´s not only about the cancel action... within the preferences save handler you have the same impact
--
AlexanderStoffers - 27 Apr 2012
Here is a fix for 1.1.5 that will be included in 1.1.6, the proper fix will have to wait for 1.2.
diff --git a/core/lib/Foswiki/UI/Manage.pm b/core/lib/Foswiki/UI/Manage.pm
index c7c85b5..7c0ec83 100644
--- a/core/lib/Foswiki/UI/Manage.pm
+++ b/core/lib/Foswiki/UI/Manage.pm
@@ -505,7 +505,7 @@ sub _action_saveSettings {
my $query = $session->{request};
if ( defined $query->param('action_cancel')
- && $query->param('action_cancel') eq 'Cancel' )
+ && $query->param('action_cancel') ne '' )
{
my $topicObject = Foswiki::Meta->new( $session, $web, $topic );
@@ -515,7 +515,7 @@ sub _action_saveSettings {
}
}
elsif ( defined $query->param('action_save')
- && $query->param('action_save') eq 'Save' )
+ && $query->param('action_save') ne '' )
{
# set up editing session
--
GeorgeClark - 02 May 2012