Foswiki on GitHub is open for business! Next release meeting: Monday October 13, 1300Z

Item11017: Redundant afterSaveHandler called before renaming

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine    
I noticed when moving a topic to Trash. FW is not creating a topic in Trash first, it first calls afterSaveHandler with the current web as web parameter.

This makes it difficult to keep a separate database in sync because there is no way to tell from the called afterSaveHandler what kind of save this was.

-- ArthurClemens - 02 Aug 2011

This happens because of this save call in line 2167:

$from->save();    # to save the metadata change
$from->{_session}->{store}->moveTopic( $from, $to, $cUID );

This call is used to store TOPICMOVED info. But do we really want to call beforeSaveHandler and afterSaveHandler with that (old) topic change?

Proposed new way:
# save the metadata change without logging
$this->saveAs(
    $this->{_web}, $this->{_topic},
    dontlog => 1, # no statistics
);

-- ArthurClemens - 04 Aug 2011

 

ItemTemplate edit

Summary Redundant afterSaveHandler called before renaming
ReportedBy ArthurClemens
Codebase 1.1.3, trunk
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:c979cf1a1c42 distro:2979ef54cea8 distro:02823214f1eb
TargetRelease patch
ReleasedIn 1.1.4
Topic revision: r8 - 17 Dec 2011, GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License