Fetch limit of zero doesnt give zero results?

Author Message

steve walker

Thursday 07 October 2004 1:47:48 am

Hi there,

Am seeing something strange with fetches and limits - seems that if you specify a limit of '0' it is interpreted as no limit at all.

I am using Paul B's contrib from http://ez.no/community/contributions/hacks/more_attribute_filter_operators_and_fetch_by_owner_id but have tested it on normal fetch and seems to replicate same result.

So, for instance - in folder.tpl, if you change 'page_limit=10' to 'page_limit=1' you get 1 result returned. If its changed to 'page_limit=0' you get full list of results returned rather than none.

The reason I need to achieve this is so this will work: http://www.ez.no/community/forum/setup_design/advanced_search_development_homemade_fuzzy_logic/re_advanced_search_development_homemade_fuzzy_logic__17

Is it not possible to have a zero page limit return zero results?

Thanks, Steve.

http://www.oneworldmarket.co.uk

Paul Borgermans

Thursday 07 October 2004 3:06:29 am

Hi Steve,

limit 0 means limit = false, so it is by design and has nothing to do with ly modifications.

I think you should surround the fetch by a test with {section show= } and not perform the test at all when you should not retrieve nodes.

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

steve walker

Thursday 07 October 2004 3:26:50 am

OK, Thanks Paul.

Will go down the section route!

Regards, Steve.

http://www.oneworldmarket.co.uk

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 19 2025 20:06:47
Script start
Timing: Jan 19 2025 20:06:47
Module start 'layout'
Timing: Jan 19 2025 20:06:47
Module start 'content'
Timing: Jan 19 2025 20:06:48
Module end 'content'
Timing: Jan 19 2025 20:06:48
Script end

Main resources:

Total runtime0.7196 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 590.4063152.6406
Module start 'layout' 0.00660.0034 743.046939.4766
Module start 'content' 0.01000.7082 782.5234531.5781
Module end 'content' 0.71820.0014 1,314.101612.2813
Script end 0.7196  1,326.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4956160.0002
Check MTime0.00160.2228160.0001
Mysql Total
Database connection0.00120.166710.0012
Mysqli_queries0.670493.1537570.0118
Looping result0.00050.0720550.0000
Template Total0.685495.220.3427
Template load0.00220.308320.0011
Template processing0.683294.928820.3416
Template load and register function0.00020.034310.0002
states
state_id_array0.00200.275010.0020
state_identifier_array0.00180.248820.0009
Override
Cache load0.00180.2558210.0001
Sytem overhead
Fetch class attribute can translate value0.00060.086420.0003
Fetch class attribute name0.00140.195140.0004
XML
Image XML parsing0.00060.090120.0003
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00080.1113170.0000
String conversion0.00000.001040.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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: 9
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs