This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » "eZContentFunctions::updateAndPublish...
expandshrink

"eZContentFunctions::updateAndPublishObject" | I want to save in a different user

"eZContentFunctions::updateAndPublishObject" | I want to save in a different user

Wednesday 06 August 2014 11:16:58 am - 4 replies

I want to save as different user,when i use updateAndPublishObject.

However it does not seem to function.

Do you know how to resolve? 

Rather than re-create the content, I want to somehow update. 

Please Help 

 
$updateParams['attributes'] = $updateAttributes;
$updateParams['creator_id'] = $diffrenetOwnerID;
$result = eZContentFunctions::updateAndPublishObject(
                    $updateObject,
                    $updateParams);

 

I hope that get answers as soon as possible 

Modified on Wednesday 06 August 2014 11:35:14 am by fuku fuku

Wednesday 06 August 2014 11:43:23 am

The object creator is not changed when you add a new version. It is the person who created version 1. So it is logical that updating the object with a new version does not change it.

Do you want to inject the custom user as object-creator or just as creator-of-the-new-version?

Wednesday 06 August 2014 11:51:46 am

Thank you for answer.

When creating a new version, I want to create as a user other than the current user.

example)

"User A", "user B" as there was

Version 1 "user A" created

-Program execution user "user B"

Version 2 create as "user A" 

 

 

I think how to achieve this? 

Modified on Wednesday 06 August 2014 12:57:00 pm by fuku fuku

Friday 08 August 2014 10:48:08 am

I think you have 2 choices:

- either alter the version creator by hand after cretaing the version (setattribute + store, 2 lines of code)

- or switch the currently-running-user before creating the version (one line of code, but it might have side effects)

Modified on Friday 08 August 2014 10:48:34 am by Gaetano Giunta

Friday 08 August 2014 1:19:00 pm

Thank you for advice a lot to me.

 I'll try several means.

Thank you.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from