Foswiki General Assembly will be held on 28th November 2019, 1200 UTC on Freenode IRC channel #foswiki-association. See AgendaTenthGeneralAssembly

Item1384: Creating webs with empty field values in the submit form fails

Priority: Urgent
Current State: Closed
Released In: 1.0.5
Target Release: patch
Applies To: Engine
Reported By: SvenDowideit
Waiting For:
Last Change By: KennethLavrsen
found it on trunk - unsure about release atm

TemplateAuth issue i suspect..

  1. start not-logged in
  2. goto ManagingWebs and create a new web. (choosing/entering some non-default options)
  3. you should get re-directed to the login screen
  4. log in as admin
  5. your web will be created, but the settings you choose do not get written, if ASSERTs are on, you will likey see a crash as the values are lost.

if you do this already logged in, it works.

-- SvenDowideit - 29 Mar 2009

I couldn't reproduce that, not on trunk, not on the release branch.

By "log in as admin", you mean as an admin user, or something else?

My settings were written, but the only settings you can specify are the colo, description, and searchall, thinks like that. And I always run with ASSERTs on, so this didn't catch it either.

-- OlivierRaginel - 30 Mar 2009

Can't reproduce it on trunk either. All works fine for me.

-- CrawfordCurrie - 31 Mar 2009

Ok, I could reproduce it! The problem is why the "admin" login. You have to login as admin, not an admin user, which was my interogation.

When I login as admin, with ASSERTs on, I get:
Use of uninitialized value in concatenation (.) or string at /.../core/lib/Foswiki/ line 367.
	at /usr/share/perl/5.10/CGI/ line 356
    CGI::Carp::realdie('Use of uninitialized value in concatenation (.) or string at ...') called at /usr/share/perl/5.10/CGI/ line 437
    CGI::Carp::die('Use of uninitialized value in concatenation (.) or string at ...') called at /.../core/lib/ line 153
    Foswiki::__ANON__('Use of uninitialized value in concatenation (.) or string at ...') called at /.../core/lib/Foswiki/ line 367
    Foswiki::Meta::populateNewWeb('Foswiki::Meta=HASH(0x246f480)', 'TestCases', 'HASH(0x246f558)') called at /.../core/lib/Foswiki/UI/ line 186
    Foswiki::UI::Manage::__ANON__() called at /usr/share/perl5/ line 416
    eval {...} called at /usr/share/perl5/ line 408
    Error::subs::try('CODE(0x246f5a0)', 'HASH(0x246f7e0)') called at /.../core/lib/Foswiki/UI/ line 194
    Foswiki::UI::Manage::_action_createweb('Foswiki=HASH(0x242a420)') called at /.../core/lib/Foswiki/UI/ line 44
    Foswiki::UI::Manage::manage('Foswiki=HASH(0x242a420)') called at /.../core/lib/Foswiki/ line 183
    Foswiki::UI::__ANON__() called at /usr/share/perl5/ line 416
    eval {...} called at /usr/share/perl5/ line 408
    Error::subs::try('CODE(0x200cb10)', 'HASH(0x246f090)') called at /.../core/lib/Foswiki/ line 252
    Foswiki::UI::execute('Foswiki::Request=HASH(0x242a8d0)', 'CODE(0x242a348)', 'manage', 1) called at /.../core/lib/Foswiki/ line 121
    Foswiki::UI::handleRequest('Foswiki::Request=HASH(0x242a8d0)') called at /.../core/lib/Foswiki/Engine/ line 26
    Foswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0x2240a40)') called 

Therefore, I propose the following patch, which seems to fix it on my test installation:
diff --git a/core/lib/Foswiki/ b/core/lib/Foswiki/
index 261f869..9fa93d1 100644
--- a/core/lib/Foswiki/
+++ b/core/lib/Foswiki/
@@ -365,7 +365,8 @@ sub populateNewWeb {
         my $text = $prefsTopicObject->text;
         foreach my $key (keys %$opts) {
             $text =~
-              s/($Foswiki::regex{setRegex}$key\s*=).*?$/$1 $opts->{$key}/gm;
+              s/($Foswiki::regex{setRegex}$key\s*=).*?$/$1 $opts->{$key}/gm
+                if defined $opts->{$key};

For the record, in my test, the following keys were undefined:

-- OlivierRaginel - 31 Mar 2009

I like your patch.

-- CrawfordCurrie - 01 Apr 2009

I have reproduced the error and fixed it using Oliviers patch. In Release01x00 I had to find the same code piece in

-- KennethLavrsen - 21 Apr 2009

ItemTemplate edit

Summary Creating webs with empty field values in the submit form fails
ReportedBy SvenDowideit
Codebase trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Priority Urgent
CurrentState Closed
Checkins distro:b33567cb6f4e
TargetRelease patch
ReleasedIn 1.0.5
Topic revision: r10 - 25 Apr 2009, KennethLavrsen - This page was cached on 19 Nov 2019 - 20:58.

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