Item2299: edit-save-rename restores an old version

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component:
Branches:
Reported By: MichaelDaum
Waiting For:
Last Change By: KennethLavrsen
  1. edit a topic
  2. save it
  3. rename the topic
  4. edits gone ... an old version is been restored

Can anybody confirm?

-- MichaelDaum - 27 Oct 2009

Confirmed on trunk frown, sad smile

  1. Create a topic in sandbox & save (-> r1)
  2. Edit and save (force new version -> r2)
  3. Edit and save (force new version -> r3)
  4. Rename (-> r3)
  5. r3 now shows content from r1 instead of r2.

Unable to replicate on release branch. I have r5389 checked out.

-- PaulHarvey - 29 Oct 2009

Added unit test, also on release branch, even though the problem does not exist there.

Oh, and fixed the bug. Problem was that we:
  1. Load a dummy topicObject with no content for the new topic
  2. Move the old topic to the new topic
  3. Try to use the dumy topic object, thinking it will magically be updated

And just adding a $to->reload is not enough as there is already a cached version of this dummy topic, therefore $to->{_loadedRev} exists and is set to revision 1, therefore, it will always use revision 1. Fix by:
  1. Removing $to->{_loadedRev}
  2. Calling $to->reload

-- OlivierRaginel - 29 Oct 2009

ItemTemplate edit

Summary edit-save-rename restores an old version
ReportedBy MichaelDaum
Codebase trunk
SVN Range Foswiki-1.0.7, Sun, 20 Sep 2009, build 5061
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:d85ff1b1ec46 distro:0c071a63836b distro:50f979bd893c
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r8 - 04 Oct 2010, KennethLavrsen
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