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.