You are here: Foswiki>Tasks Web>Item11798 (02 Dec 2012, GeorgeClark)Edit Attach

Item11798: Save/Cancel on Edit Topic Settings dialog fails with an error for non-English localizated sites.

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.6
Target Release: patch
Applies To: Engine
Component: FoswikiUIManage
Branches: Release01x01 trunk
Reported By: AlexanderStoffers
Waiting For:
Last Change By: GeorgeClark
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
 

ItemTemplate edit

Summary Save/Cancel on Edit Topic Settings dialog fails with an error for non-English localizated sites.
ReportedBy AlexanderStoffers
Codebase 1.1.5, trunk
SVN Range
AppliesTo Engine
Component FoswikiUIManage
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:6f2b40508aca distro:f6c7154ed67b
TargetRelease patch
ReleasedIn 1.1.6
CheckinsOnBranches Release01x01 trunk
trunkCheckins distro:f6c7154ed67b
Release01x01Checkins distro:6f2b40508aca
Topic revision: r9 - 02 Dec 2012, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy