eZ Community » Forums » Extensions » eZ Flow » Update source nodes for dynamic blocks
expandshrink

Update source nodes for dynamic blocks

Update source nodes for dynamic blocks

Tuesday 08 July 2008 3:28:43 pm - 2 replies

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 happy.gif Emoticon

Tuesday 08 July 2008 3:32:55 pm

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 );

Tuesday 08 July 2008 4:20:55 pm

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.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from