NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item9693 for docu changes for 1.2 and 2.0.

Item10665: can't copy attachments under a different user

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Closed Engine    
This is an error in the Foswiki::Meta class. The copyAttachment() function allows to do that operation overriding the currently logged in user with another optional user, e.g. calling it like

$fromMeta->copyAttachment("image.gif", $toMeta, user => "SomeUserID");

However this fails halting the server in a deadlock.

The copyAttachment() method creates an atomic lock for the given user "SomeUserID" and will afterwards try to create yet another atomic lock as part of the saveAs() operation. This normally all comes out fine _as long as you do not use the user=>"SomeUserID" override feature. Otherwise the second try to lock the topic is done using with the current user id in saveAs() which not necessarily equals "SomeUserId" provided to copyAttachment().

The fix is to pass the user=>"SomeUserID" override down to the saveAs() call part of the copy action.

(... which for saveAs() must be a author=>"SomeUserID" option ...)

-- MichaelDaum - 21 Apr 2011

 

ItemTemplate edit

Summary can't copy attachments under a different user
ReportedBy MichaelDaum
Codebase 1.1.3, trunk
SVN Range
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins Foswikirev:11526 Foswikirev:11527
TargetRelease patch
ReleasedIn 1.1.4
Topic revision: r4 - 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 LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads