Forums / Setup & design / sort by class attribute .. bug or not complate ?

sort by class attribute .. bug or not complate ?

Author Message

Selmah Maxim

Tuesday 19 August 2003 8:16:51 am

Hi ..

am trying to sort data by class attribute work fine, but the data is duplicated , when take a look at 'ezcontentclass_attribute' table in the DB I found there is 2 version of the class .. maybe this the wrong ?
here is the the tmp code :

_________________________

{let tree=fetch('content','list',hash(parent_node_id,$node.node_id,
class_filter_type, "include",
class_filter_array, array($CompanyDataClassID),
sort_by,array(array('attribute',false(),207))
))}
{*sort_by,array(array("name",true()))*}
{section loop=$tree sequence=array(bglight,bgdark) name=Tree}
{section show=eq($Tree:item.data_map.first_ad_view.data_int,"1")}
{run-once}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1" valign="top"><img src={"spacer.gif"|ezimage} width="1" height="20">
</td>
<td valign="bottom"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#CCCCCC"><img src={"spacer.gif"|ezimage} width="1" height="1"></td>
</tr>
</table></td>
</tr>
</table>
<div style="BACKGROUND:#EFF0F0">{/run-once}
{node_view_gui view=first_ad content_node=$Tree:item}
{run-once}</div>{/run-once}
{section-else}
{node_view_gui view=ads content_node=$Tree:item Key=$Tree:number}
{/section}
{/section}

{/let}
________________________

207 is boolen (0,1) checkbox and just this line is duplicat the result :
{node_view_gui view=ads content_node=$Tree:item Key=$Tree:number}

any idea ?

thx.

Selmah Maxim

Tuesday 19 August 2003 8:58:49 am

Just forgot to say its work normal if I sort iy by name :

sort_by,array(array("name",true()))

Selmah Maxim

Tuesday 19 August 2003 11:27:11 pm

any plz :(

Selmah Maxim

Saturday 23 August 2003 7:56:22 am

whats up .. i`m the only one who facing this problem !!

I must sort the data by class attribute :(

Selmah Maxim

Saturday 23 August 2003 8:31:09 am

after I got the sql debug and make the query via phpmysql i got duplicated rows .. this mean my code is ok, and also the bug is either the inserting to the DB or the query from DB .. I hope is the query is the error rather than the insertion !

this is the query from sql debug :
__________
SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name
, ezcontentobject_name.name as name, ezcontentobject_name.real_translation
FROM
ezcontentobject_tree,
ezcontentobject,ezcontentclass
, ezcontentobject_name
, ezcontentobject_attribute as a0

WHERE
path_string like '/1/2/43/49/51/%' and depth <= 5 and
a0.contentobject_id = ezcontentobject.id AND
a0.contentclassattribute_id = 207 AND
a0.version = ezcontentobject_name.content_version AND

ezcontentclass.version=0 AND
node_id != 51 AND
ezcontentobject_tree.contentobject_id = ezcontentobject.id AND
ezcontentclass.id = ezcontentobject.contentclass_id AND
( ezcontentobject.contentclass_id = '15' ) AND
ezcontentobject_tree.contentobject_is_published = 1
and ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
ezcontentobject_name.content_translation = 'he'
ORDER BY a0.sort_key DESC
LIMIT 0, 10
_____________________________

pls don`t take this as I flooding the forum, just adding the latest what i get to discover who need to modify, me or ez crew !

thx in advance!

Bjørn Kaarstein

Monday 25 August 2003 4:18:52 am

I believe that sorting by class attributes will be ready in the 3.2 release. I don't think that's possible in earlier versions.

-Regards Bjørn

Albert Berenguer

Friday 16 January 2004 8:22:20 am

Maybe its late but I had the same problem and I managed to solve it.

Look at:
http://ez.no/developer/ez_publish...ttribute_filter_ignores_translations

and

http://ez.no/developer/ez_publish...slation_duplicates_bug_incl_quickfix

-Berto

Albert Berenguer

Friday 16 January 2004 8:23:57 am

sorry the links where incomplete, theese are the good ones:

http://ez.no/developer/ez_publish_3/bug_reports/sort_by_attribute_translation_duplicates_bug_incl_quickfix

and

http://ez.no/developer/ez_publish_3/bug_reports/fetching_children_with_attribute_filter_ignores_translations

eZ debug

Timing: Jan 31 2025 01:24:12
Script start
Timing: Jan 31 2025 01:24:12
Module start 'content'
Timing: Jan 31 2025 01:24:12
Module end 'content'
Timing: Jan 31 2025 01:24:12
Script end

Main resources:

Total runtime0.2131 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 588.0625370.2734
Module start 'content' 0.00770.0162 958.33591,009.4688
Module end 'content' 0.02390.1891 1,967.80473,905.0391
Script end 0.2130  5,872.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00502.3609200.0003
Check MTime0.00150.6917200.0001
Mysql Total
Database connection0.00070.316810.0007
Mysqli_queries0.112052.57051410.0008
Looping result0.00140.66141390.0000
Template Total0.188688.510.1886
Template load0.00090.432710.0009
Template processing0.187788.083010.1877
Override
Cache load0.00060.290510.0006
Sytem overhead
Fetch class attribute can translate value0.00180.860210.0018
XML
Image XML parsing0.00020.104710.0002
General
dbfile0.00994.6287200.0005
String conversion0.00000.002830.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs