You are here: Foswiki>Tasks Web>Item11017 (17 Dec 2011, GeorgeClark)Edit Attach

Item11017: Redundant afterSaveHandler called before renaming

Priority: Normal
Current State: Closed
Released In: 1.1.4
Target Release: patch
Applies To: Engine
Reported By: ArthurClemens
Waiting For:
Last Change By: GeorgeClark
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->{_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
Priority Normal
CurrentState Closed
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 Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy