Update source nodes for dynamic blocks

Author Message

Kostadinka Ignatieva

Tuesday 08 July 2008 6:28:43 am

Hi,

I have the following problem with ezFlow dynamic blocks:
when i add a dynamic block and press 'choose source' for the first time, all works great. When i want to change the source node of the block, even if i press 'choose source' and choose a new source node, the items of the block remain the same (nothing changes except the name of the source on the right top corner of the block).

After some testing i found a solution for my problem. I did some changes to ezflowlatestobjects.php, but i am not sure if these changes won't affect the work of rotation and overflow mechanisms of the extension, since i don't use them for now. My changes are mainly related to 'AttributeFilter' parameter, since the fetches in the script returned always NULL. Now i only check for objects that are published before current timestamp (today) and sort them by priority. I removed the check for objects being published after the last update of block (block['last_update']).

First on line 36 i removed the whole block:

$node = eZContentObjectTreeNode::fetch( $nodeID, false, false ); // not as an object
if ( $node && $node['modified_subnode'] <= $publishedAfter )
{
return array();
}

and left only the line: $nodeID = $parameters['Source'];

Second i removed line 53: array( 'published', '>', $publishedAfter ) and left only the second part - array( 'published', '<=', $publishedBeforeOrAt ). Now my 'AttributeFilter' is like:

$subTreeParameters['AttributeFilter'] = array(
'and',
array( 'published', '<=', $publishedBeforeOrAt )
);

So that solved the problem for now, but i would like to ask if anybody had the same problem and maybe a better solution to it! Thanks in advance :)

Iguana IT - http://www.iguanait.com

Kostadinka Ignatieva

Tuesday 08 July 2008 6:32:55 am

Sorry, i made a mistake in my previous post - i meant:

Now i only check for objects that are published before current timestamp (today) and sort them by publishing date:

$subTreeParameters['SortBy'] = array( 'published', true );

Iguana IT - http://www.iguanait.com

Bin LIU

Tuesday 08 July 2008 7:20:55 am

When you change the "source" by the buttun "choose source", you should delete all items in the list, and you publish the node.

It's OK.

=== Lagardère Active ===

Fetch random
http://projects.ez.no/la_fetch_random
LA Static Cache
http://projects.ez.no/lastaticcache
LA Bookmarks (jquery)
http://projects.ez.no/labookmark
LA Calendar (jquery)
http://projects.ez.no/lacalendar

My site ez
http://lingping.info

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 30 2025 00:58:11
Script start
Timing: Jan 30 2025 00:58:12
Module start 'layout'
Timing: Jan 30 2025 00:58:12
Module start 'content'
Timing: Jan 30 2025 00:58:12
Module end 'content'
Timing: Jan 30 2025 00:58:12
Script end

Main resources:

Total runtime0.0380 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 588.2813151.2266
Module start 'layout' 0.00840.0073 739.507836.6797
Module start 'content' 0.01570.0206 776.187595.2344
Module end 'content' 0.03630.0017 871.421933.9922
Script end 0.0380  905.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00266.8130140.0002
Check MTime0.00123.1162140.0001
Mysql Total
Database connection0.00194.902810.0019
Mysqli_queries0.008321.905930.0028
Looping result0.00000.073410.0000
Template Total0.00112.910.0011
Template load0.00092.341010.0009
Template processing0.00020.575710.0002
Override
Cache load0.00061.596610.0006
General
dbfile0.010427.384580.0013
String conversion0.00000.031440.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