ezImage Gallery skips content

Author Message

Torbjørn L.

Wednesday 08 June 2011 6:55:53 am

Hi,

I have an ezimagegallery that I combine with ezmultiupload, and to my horror some images gets skipped in the next/prev images button.

I list out the array of images in that particular gallery and they jumbles some of the images, effectively skipping those.

I also experienced that the next array just deleted one image when I listed them out.

Anybody has anything to help me with here?

the code for next and prev array:

 {def $all_images = fetch( 'content', 'list', 
hash( 'parent_node_id', $node.parent_node_id,
'class_filter_type', 'include',
'class_filter_array', array( 'image' ), 
'limit', '20', 
'attribute_filter', array( 'and',
array( $sort_column, $sort_order|choose( '>', '<' ), $sort_column_value ) ),
'sort_by', array( $sort_column, $sort_order|not ) ) )}
{foreach $all_images as $indexnr=>$currimg}
{$indexnr}: {$currimg.name}<br />
{/foreach}
<br/>
{def $all_images_next = fetch( 'content', 'list', 
hash( 'parent_node_id', $node.parent_node_id, 
'class_filter_type', 'include',
'class_filter_array', array( 'image' ),
'limit', '20',
'attribute_filter', array( 'and', 
array( $sort_column, $sort_order|choose( '<', '>' ), $sort_column_value ) ),
'sort_by', array( $sort_column, $sort_order ) ) )}
{foreach $all_images_next as $indexnr2=>$currimg2}
{$indexnr2}: {$currimg2.name}<br />
{/foreach}

André R.

Thursday 09 June 2011 6:57:02 am

This was fixed in 4.5 (and the two community builds so far), take a look there.

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

Torbjørn L.

Tuesday 14 June 2011 4:07:15 am

I rebuilt the select statement and made it into one foreach with three if checks and a break.

Like this:



{def $nextimg='false'}
{def $nextimg_obj=0}
{def $previmg='false'}
{def $previmg_obj='false'}
{foreach $node.parent.children as $thechild}
{if $thechild.class_identifier|eq('image')}
{*3*}
{if $nextimg|eq('true')}
{set $nextimg_obj=$thechild}
{set $nextimg='false'}
{break}
{/if}
{*2*}
{if $thechild.node_id|eq($node.node_id|int())}
{set $nextimg='true'}
{set $previmg_obj=$previmg}
{/if}
{*1*}
{set $previmg=$thechild}
{/if}
{/foreach} 

But thanks for the suggestion

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 02:01:32
Script start
Timing: Jan 18 2025 02:01:32
Module start 'layout'
Timing: Jan 18 2025 02:01:32
Module start 'content'
Timing: Jan 18 2025 02:01:32
Module end 'content'
Timing: Jan 18 2025 02:01:32
Script end

Main resources:

Total runtime0.0166 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.0469152.6250
Module start 'layout' 0.00660.0030 741.671939.4531
Module start 'content' 0.00960.0050 781.125093.3672
Module end 'content' 0.01450.0020 874.492234.2891
Script end 0.0165  908.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002716.1400140.0002
Check MTime0.00127.1027140.0001
Mysql Total
Database connection0.00148.736510.0014
Mysqli_queries0.002816.864130.0009
Looping result0.00000.102210.0000
Template Total0.001710.010.0017
Template load0.00095.271610.0009
Template processing0.00084.697210.0008
Override
Cache load0.00063.640610.0006
General
dbfile0.00031.625280.0000
String conversion0.00000.063340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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