Forums / Setup & design / fetch limitation parameter

fetch limitation parameter

Author Message

James Ward

Tuesday 24 January 2006 5:25:55 pm

running ez 3.7.2

Has anyone got a working example of the fetch limitation parameter mentioned in the docs at: http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/list

I tried the following to fetch a subnode that the anonymous user can not access:

{def $emptyarray=array()}
{def $objects=fetch(content, list, hash(parent_node_id, $node.node_id, 
                                        limitation, array ( $emptyarray ) ) )}

I'm not sure if this paramter is working yet as the documentation is a little vague. The docs would seem to indicate that I can use this to ignore user permissions and fetch subnodes.

Thanks in advance.

working at www.wardnet.com
blogging at www.jamesward.ca

Kristof Coomans

Tuesday 24 January 2006 11:25:26 pm

Take a look at eZContentObjectTreeNode::createPermissionCheckingSQLString. It gets called with the limitation array you provided, and adds extra SQL conditions according to the entries in the limitation array. An emtpy limitation array should result in no extra conditions, so it disables any policy checking.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Ɓukasz Serwatka

Tuesday 24 January 2006 11:47:11 pm

Example which will work is:

{def $objects=fetch(content, list, hash(parent_node_id, $node.node_id, 
                                       limitation, array() ) )}

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

James Ward

Wednesday 25 January 2006 8:50:42 am

Thanks Lukasz,
I had actually tried that way first but thought it was not working. My problem was in my understanding of what you can and can not do with the fetched information. After the object fetch without limitation I was attempting to view the node with the following:

{node_view_gui view=full content_node=$objects[0]}

Which obviously is not allowed, I assume because the fetches within that node view will be restricted by the permisison limitations.

As soon as I used the following I was able to see information within the restricted node:

{attribute_view_gui attribute=$objects[0].data_map.name}

In retrospect this makes complete sense and is a logical way for the limitation parameter to work.

Thanks for all your help.

working at www.wardnet.com
blogging at www.jamesward.ca

eZ debug

Timing: Jan 18 2025 19:34:40
Script start
Timing: Jan 18 2025 19:34:40
Module start 'content'
Timing: Jan 18 2025 19:34:41
Module end 'content'
Timing: Jan 18 2025 19:34:41
Script end

Main resources:

Total runtime0.8716 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 587.7109180.8359
Module start 'content' 0.00720.7139 768.5469607.9922
Module end 'content' 0.72110.1505 1,376.5391337.3750
Script end 0.8715  1,713.9141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00500.5736210.0002
Check MTime0.00170.1973210.0001
Mysql Total
Database connection0.00120.133410.0012
Mysqli_queries0.783089.83851990.0039
Looping result0.00230.26171970.0000
Template Total0.839296.320.4196
Template load0.00230.266720.0012
Template processing0.836896.011820.4184
Template load and register function0.00010.009710.0001
states
state_id_array0.00080.089710.0008
state_identifier_array0.00160.179520.0008
Override
Cache load0.00200.2261270.0001
Sytem overhead
Fetch class attribute can translate value0.00170.193540.0004
Fetch class attribute name0.00100.118470.0001
XML
Image XML parsing0.00230.262240.0006
class_abstraction
Instantiating content class attribute0.00000.001780.0000
General
dbfile0.00460.5291410.0001
String conversion0.00000.000630.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 7

Time used to render debug report: 0.0001 secs