Forums / Setup & design / confused by owner, creator, modified, created, published, ..

confused by owner, creator, modified, created, published, ..

Author Message

*- pike

Tuesday 02 June 2009 1:38:22 pm

Hi

ezpublish has a number of attributes to choose from to show the history of a node, object, or version. I've found

    * $node.creator (contentobjecttreenode)
    * $node.object.owner (contentobject)
    * $node.object.current.creator (contentobjectversion)
    * $node.object.modified (contentobject)
    * $node.object.published (contentobject)
    * $node.object.current.created (contentobjectversion)
    * $node.object.current.modified (contentobjectversion)

It seems all these values can be different. how do they relate to each other ?
and then, when doing a fetch("content","list", you can sort results by

   * 'sort_by',array('modified',false())
   * 'sort_by',array('published',false())

which values does that refer to ?

confused,
*-pike

---------------
The class eZContentObjectTreeNode does.

Ivo Lukac

Wednesday 03 June 2009 12:41:14 am

'creator' - user who modified (last) version
'owner' - user who created first version, original creator
'published' - time of first creation (can be changed with workflow)
'modified' - time of version change

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

*- pike

Wednesday 03 June 2009 5:34:52 am

hi

so

'owner' = $node.object.owner == $node.object.versions[0].creator
'creator' = $node.creator == $node.object.current.creator
'modified' = $node.object.modified == $node.object.current.modified
'published' = $node.object.versions[0].created
'(unnamed)' = $node.object.current.created

is that correct ? am I missing one ?
what keeps those values in sync ?

thanks,
*-pike

---------------
The class eZContentObjectTreeNode does.

Ivo Lukac

Wednesday 03 June 2009 5:52:34 am

AFAIK that is it.

Don't know exactly what $node.object.current.created is. Probably that is time when draft is created and $node.object.current.modified is when the draft is saved. Or something like that.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

*- pike

Thursday 04 June 2009 11:42:17 am

Thanks - let me be more specific.

I need to *set* the creation date, modification date, creator and owner on a node, using PHP. But I'm not really sure what to set, to start with.

I've tried

$version->setAttribute( 'created', $set_created);
$version->setAttribute( 'creator_id', $set_creator_id);
$version->setAttribute( 'modified', $set_modified);

where $version is a current contentObjectVersion, and then did a

$operationResult = eZOperationHandler::execute( 'content','publish', array(
 	'object_id' => $version->attribute( 'contentobject_id' ),
	'version' => $version->attribute( 'version' ) 
) );

The result in the admin interface is even more confusing. The values seem to be set on the current version, but the *object's* modifier is me and the modification date now.

Does anyone know how to do this ?

thanks,
*-pike

---------------
The class eZContentObjectTreeNode does.

*- pike

Friday 10 July 2009 10:17:27 am

The fact that the admin (history page) is confusing may be due to a bug in the admin:
http://issues.ez.no/IssueView.php?Id=15157

---------------
The class eZContentObjectTreeNode does.

*- pike

Friday 10 July 2009 10:30:46 am

I'm testing a bit .. since nobody knows and imho its a bit of a mess there :-)
So I'm pushing numbers straight into the database using SQL to see what *output* changes in the template operators. I can not, this way, see what internal php logic would keep the several values in sync, or how.

the treenode has no fields in the database to store userids, so $node.creator must be read from either the object beneath the node or one of its versions. I should add I'm using ezp 4.03.

I'm focusing on 4 things:
- the object
- the initial version from $object.versions[0]
- the initial version from fetch('content','version_list',..)
- the current version from $object.current

It should be noted both initial versions return different objects, allthough they have the same $version.id, see http://issues.ez.no/IssueView.php?Id=15158

If I change initial version creator id in the db
	this changes: 
                $initialfetched.creator
	
If I change current version creator id  in the db
	these change:
		$node.creator
		$node.object.versions[0].creator (that seems wrong)
		$node.object.current.creator 
	but this doesnt
		$node.object.owner

If I change object owner id  in the db
	only this changes:
		$node.object.owner

So $node.object.owner may be synced by some other internal method in php, eg content/publish. And $node.object.versions[0].creator seems to be incorrect. the admin history page uses the fetch(content.version_list and shows the right values.

More to come,
*-pike

---------------
The class eZContentObjectTreeNode does.

*- pike

Friday 10 July 2009 11:21:49 am

I did the same for 'version.created', 'version.modified', 'object.modified' and 'object.published'.

change initial version "created"
	this changes
		initialfetched.created
		
change initial version "modified"
	this changes
		initialfetched.modified
		
change current version "created"
	changes
		$node.object.versions[0].created (that seems wrong)
		$node.object.current.created
		
change current version "modified"
	changes
		$node.object.versions[0].modified (that seems wrong)
		$node.object.current.modified
		
change object "created"
	changes
		$node.object.created

change object "published"
	changes
		$node.object. published

So again, $node.object.* seems to be kept in sync using php, and $node.object.versions[0] seems wrong.

That doesnt really answer my original question :-) But I know a bit more now:

To change $node.creator, I have to change $node.object.current.creator

To change $node.object.owner, I can just set it in SQL. Common sense tells me to update the "creator" of the first version as well.

To change $node.object.modified, I can just set it in SQL. Common sense tells me to update the "modified" of the current version as well.

.. and $node.object.published i can apparently just set using SQL. Common sense tells me to update the "modified" of the first version as well.

And
* 'sort_by',array('modified',false())
* 'sort_by',array('published',false())
will most likely sort by $object.modified and $object.published, allthough i havent checked that.

$2c,
*-pike

 

---------------
The class eZContentObjectTreeNode does.

eZ debug

Timing: Jan 18 2025 14:53:38
Script start
Timing: Jan 18 2025 14:53:38
Module start 'content'
Timing: Jan 18 2025 14:53:39
Module end 'content'
Timing: Jan 18 2025 14:53:39
Script end

Main resources:

Total runtime1.3746 sec
Peak memory usage4,096.0000 KB
Database Queries209

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.0859180.8125
Module start 'content' 0.00661.1683 769.8984627.2891
Module end 'content' 1.17480.1997 1,397.1875345.0234
Script end 1.3745  1,742.2109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.2982210.0002
Check MTime0.00150.1099210.0001
Mysql Total
Database connection0.00110.081810.0011
Mysqli_queries1.283093.33972090.0061
Looping result0.00250.18192070.0000
Template Total1.346498.020.6732
Template load0.00210.155620.0011
Template processing1.344397.794620.6721
Template load and register function0.00040.029610.0004
states
state_id_array0.00090.069010.0009
state_identifier_array0.00140.103420.0007
Override
Cache load0.00200.1451740.0000
Sytem overhead
Fetch class attribute can translate value0.00160.119130.0005
Fetch class attribute name0.00110.077090.0001
XML
Image XML parsing0.00100.073530.0003
class_abstraction
Instantiating content class attribute0.00000.0013100.0000
General
dbfile0.00590.4265280.0002
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
22content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
12content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 53
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs