Forums / Developer / Container users??

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

eZ debug

Timing: Jan 18 2025 16:09:44
Script start
Timing: Jan 18 2025 16:09:44
Module start 'content'
Timing: Jan 18 2025 16:09:45
Module end 'content'
Timing: Jan 18 2025 16:09:45
Script end

Main resources:

Total runtime0.8731 sec
Peak memory usage4,096.0000 KB
Database Queries207

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.0313180.8516
Module start 'content' 0.00560.7333 769.8828652.8047
Module end 'content' 0.73890.1341 1,422.6875337.0703
Script end 0.8730  1,759.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.4944210.0002
Check MTime0.00160.1831210.0001
Mysql Total
Database connection0.00060.071410.0006
Mysqli_queries0.795691.12172070.0038
Looping result0.00250.28112050.0000
Template Total0.847097.020.4235
Template load0.00250.281920.0012
Template processing0.844596.731320.4223
Template load and register function0.00020.022710.0002
states
state_id_array0.00090.099410.0009
state_identifier_array0.00070.075920.0003
Override
Cache load0.00210.2384370.0001
Sytem overhead
Fetch class attribute can translate value0.00140.159350.0003
Fetch class attribute name0.00100.110280.0001
XML
Image XML parsing0.00180.202150.0004
class_abstraction
Instantiating content class attribute0.00000.001480.0000
General
dbfile0.00280.3210360.0001
String conversion0.00000.000830.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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