Container users??

Author Message

luis muñoz

Sunday 17 June 2007 7:09:56 am

Hi,

I modified user class to be container. Then created a new content class which will live under the user. Then i created content with no problems.

The problem starts when i try to recover that nodes under the user. Using code like

{def $usuario=fetch('user','current_user')}
{def $nodes_list=fetch('content','list',hash('parent_node_id', $usuario.contentobject.main_node_id))}

doesn´t work. Returns an empty array. But if i manually fetch one of the nodes under $usuario with something like

{def $nodes_list=fetch('content','list',hash('parent_node_id', 113))}

It returns the node with no problems.

Also tried the code from the admin siteacces (copy / paste) with the same results.

Is this a bug? Is there any way to fetch all nodes under a user??

Thanks

André R.

Sunday 17 June 2007 1:26:18 pm

what is $usuario.contentobject.main_node_id if you output it ?

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

luis muñoz

Monday 18 June 2007 12:15:15 am

Hi,

$usuario.contentobject.main_node_id is the actual user node_id. I fetched user in the line before :

{def $usuario=fetch('user','current_user')}

Because $usuario.node_id is not definided and the only thing i found with the same value was $usuario.contentobject.main_node_id.

Thanks

Luis

luis muñoz

Monday 18 June 2007 9:22:18 am

Hi,

I'm stuck about this. Any idea about how to fetch content under the user? is this a bug? a feature?

Any help would be appreciated

Luis Muñoz

Joe Kepley

Monday 18 June 2007 8:03:01 pm

Your $usario variable contains a User object, which is a different from the user's content object.

$usario.contentobject.main_node_id is the correct variable to call for the main_node_id.

If this fetch isn't returning anything, there are a couple of things to check:

* Check the anonymous role (or whatever role you're using) to ensure that you can read the content objects

* Check the role assignment to ensure that it's not limited to say, media and content.

Łukasz Serwatka

Monday 18 June 2007 11:55:01 pm

It is also good idea to enable debug output with SQL output, you can see what is wrong there.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 10:30:30
Script start
Timing: Jan 18 2025 10:30:30
Module start 'layout'
Timing: Jan 18 2025 10:30:30
Module start 'content'
Timing: Jan 18 2025 10:30:31
Module end 'content'
Timing: Jan 18 2025 10:30:31
Script end

Main resources:

Total runtime1.0372 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 587.7891152.6094
Module start 'layout' 0.00750.0029 740.398439.4141
Module start 'content' 0.01031.0254 779.8125647.7422
Module end 'content' 1.03580.0014 1,427.554716.1875
Script end 1.0372  1,443.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3099160.0002
Check MTime0.00130.1252160.0001
Mysql Total
Database connection0.00100.099210.0010
Mysqli_queries0.970493.5545700.0139
Looping result0.00070.0721680.0000
Template Total0.976894.220.4884
Template load0.00220.209020.0011
Template processing0.974693.964820.4873
Template load and register function0.00020.018810.0002
states
state_id_array0.00220.209010.0022
state_identifier_array0.00180.176620.0009
Override
Cache load0.00190.1786370.0001
Sytem overhead
Fetch class attribute can translate value0.00070.065840.0002
Fetch class attribute name0.00140.134080.0002
XML
Image XML parsing0.00140.130540.0003
class_abstraction
Instantiating content class attribute0.00000.001680.0000
General
dbfile0.00470.4540250.0002
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs