You are here: Foswiki>Tasks Web>Item321 (12 Sep 2010, OliverKrueger)Edit Attach

Item321: createWeb doesnt allow subwebs as system web templates

pencil
Priority: Normal
Current State: No Action Required
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component:
Branches:
Reported By: Foswiki:Main.OliverKrueger
Waiting For:
Last Change By: OliverKrueger
Foswiki distinguishes between system webs (starting with "_") and normal webs when creating new webs based on a template / baseweb. For system webs all topics (and not just Web* topics) are copied over to the new web.

The current implementation expects system webs to be webs on the highest level (not subwebs).

If nobody objects, I will change the regex in Foswiki::Store::createWeb from

    unless ( $baseWeb =~ /^_/ ) {

        # not a system web, so filter for only Web* topics
        @topicList = grep { /^Web/ } @topicList;
    }

to

    unless ( $baseWeb =~ /^.*[\/.]_([^\/.]+)/ ) {

        # not a system web, so filter for only Web* topics
        @topicList = grep { /^Web/ } @topicList;
    }

to support subwebs at this point.

-- OliverKrueger - 27 Nov 2008

there's an assumption that you'll be making unit tests to examine and expose any risks?

-- SvenDowideit

Do I need a FeatureRequest for this?

-- OliverKrueger - 28 Mar 2010

i would say not; seems like a "straightforward" bug to me. sven is just asking that you make the appropriate tests...

-- WillNorris - 29 Mar 2010

Agree.

-- CrawfordCurrie - 28 Aug 2010

Too late for the 1.0 release. In 1.1 this is already done with a
/(?:^_|\/_)/
in Foswiki::WebFilter.

Closing.

-- OliverKrueger - 12 Sep 2010

ItemTemplate edit

Summary createWeb doesnt allow subwebs as system web templates
ReportedBy Foswiki:Main.OliverKrueger
Codebase
SVN Range TWiki-4.2.3, Wed, 06 Aug 2008, build 17396
AppliesTo Engine
Component
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r7 - 12 Sep 2010, OliverKrueger
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