Distinct in extented attribute filter

Author Message

Nicolas Lescure

Wednesday 31 October 2007 4:39:44 am

Hi,

I'm trying to create my own extend attribute filter. I need a SQL "in" (ex : li1.to_contentobject_id in (171,139) ). As I'm fetching on objects relation, the query brings me the same object twice (or more).

The solution is to add a "distinct" in the query. But Can I do that with an extend attribute filter ?

Is there another solution ? Any suggestion ?

I'm using the enhanced object relation datatype(http://ez.no/developer/contribs/datatypes/enhanced_objectrelation) instead of the originale eZ Publish objects relations datatype.

Björn Dieding@xrow.de

Wednesday 31 October 2007 6:50:48 am

Sorry distinct can`t be used in a extended attribute filter unless you have it in a sub query in your where clause

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Nicolas Lescure

Sunday 04 November 2007 10:13:48 am

Thank you for your answer, even if it's not what I expected.

I checked the kernel. It seems my problem is solved in eZ Publish 3.10. All queries with extended attribute filter have a "distinct". And you can add fields in the "select", which is not possible in eZ Publish 3.9.x.

I think I'll patch the kernel.

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 21:17:24
Script start
Timing: Jan 18 2025 21:17:24
Module start 'layout'
Timing: Jan 18 2025 21:17:24
Module start 'content'
Timing: Jan 18 2025 21:17:25
Module end 'content'
Timing: Jan 18 2025 21:17:25
Script end

Main resources:

Total runtime0.9105 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.0057 588.0156152.6250
Module start 'layout' 0.00570.0021 740.640639.4453
Module start 'content' 0.00780.9012 780.0859538.0781
Module end 'content' 0.90900.0014 1,318.164112.1563
Script end 0.9104  1,330.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.3239160.0002
Check MTime0.00120.1293160.0001
Mysql Total
Database connection0.00070.071610.0007
Mysqli_queries0.862094.6823570.0151
Looping result0.00060.0639550.0000
Template Total0.881696.820.4408
Template load0.00200.220820.0010
Template processing0.879596.602920.4398
Template load and register function0.00040.042910.0004
states
state_id_array0.00070.071910.0007
state_identifier_array0.00080.086420.0004
Override
Cache load0.00170.1830170.0001
Sytem overhead
Fetch class attribute can translate value0.00070.079220.0004
Fetch class attribute name0.00090.103250.0002
XML
Image XML parsing0.00100.111220.0005
class_abstraction
Instantiating content class attribute0.00000.001660.0000
General
dbfile0.00180.1979220.0001
String conversion0.00000.000840.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs