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

Item11767: The Copy topic feature on More topic actions doesn't take over an existing parent/child setting.

pencil
Priority: Normal
Current State: Closed
Released In: 1.1.6
Target Release: patch
Applies To: Engine
Component: FoswikiUIEdit, templates/more.tmpl
Branches: Release01x01 trunk
Reported By: FranzJosefGigler
Waiting For:
Last Change By: GeorgeClark
Shouldn't the Copy feature on More also copy an existing parent/child setting?

And are there possibly other META-data that aren't taken over to the copy?

Alternatively maybe it could be made possible to also specify a new parent for a topic copy along/together with a new name by taking advantage of the value of the input field or a selected value in the pick list of the area Set new topic parent on the More page. --> This would be a new feature.

-- FranzJosefGigler - 17 Apr 2012

I think it should copy the topic parent, so that it's easy to clone a number of similar children to a topic; however the children of a topic are a property of the respective child topic (the child topic's "parent" property) and cannot be copied.

I see two ways to achieve this:

  • add code to Foswiki::UI::Edit that clones the TOPICPARENT property when the topic to be edited is new, like so:
--- a/lib/Foswiki/UI/Edit.pm
+++ b/lib/Foswiki/UI/Edit.pm
@@ -291,6 +291,9 @@ sub init_edit {
         # Copy preference values
         $topicObject->copyFrom( $ttom, 'PREFERENCE' );

+        # Copy topic parent value
+        $topicObject->copyFrom( $ttom, 'TOPICPARENT' );
+
         # Copy the text
         $topicObject->text( $ttom->text() );

  • or add a hidden input field named "topicparent" to templates/more.tmpl, like so:
--- a/templates/more.tmpl
+++ b/templates/more.tmpl
@@ -42,6 +42,7 @@
 <input type="hidden" name="nowysiwyg" value="1" />
 <input type="hidden" name="notemplateexpansion" value="on" />
 <input type="hidden" name="action_save" value="1" />
+<input type="hidden" name="topicparent" value="%META{"parent" dontrecurse="on" format="$web.$topic"}%" />
 </form>
 %TMPL:END%

Before daring to commit anything, though, I'd like to hear comments from people more experienced with the code, particularly regarding possible side effects of the first solution...

-- FlorianSchlichting - 24 Jul 2012

 

ItemTemplate edit

Summary The Copy topic feature on More topic actions doesn't take over an existing parent/child setting.
ReportedBy FranzJosefGigler
Codebase 1.1.5, trunk
SVN Range
AppliesTo Engine
Component FoswikiUIEdit, templates/more.tmpl
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:3a78a312e16f distro:c9f5524e022c
TargetRelease patch
ReleasedIn 1.1.6
CheckinsOnBranches Release01x01 trunk
trunkCheckins distro:3a78a312e16f
Release01x01Checkins distro:c9f5524e022c
Topic revision: r6 - 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