Item11017: Redundant afterSaveHandler called before renaming
Priority: Normal
Current State: Closed
Released In: 1.1.4
Target Release: patch
Applies To: Engine
Component:
Branches:
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