Path

ez projects / ezcontentstaging / forum / general / ezflow fields


eZFlow fields

You need to be logged in to post messages in the forums. New users may register here.

Nicolas Gommenginger

Member since:
10 November 2009

Posts: 17

Thursday 21 February 2013 3:33:32 pm

Hi,
I have some issues with ezflow layout fields.
In the model "field.php":



// 2.2.1 if block type is manual, we need to transport over its items


if ( $ini->hasVariable( $blockType, 'ManualAddingOfItems' ) && $ini->variable( $blockType, 'ManualAddingOfItems' ) == 'enabled' )


{


        /// q: shall we also encode archived nodes?


        $blockItems[$block->attribute( 'id' )] = array(


                'valid' => self::transformBlockItemsToRemote( $block->attribute( 'valid' ), $ridGenerator ),


                'waiting' => self::transformBlockItemsToRemote( $block->attribute( 'waiting' ), $ridGenerator )


        );


        $manual = true;


}



What is the purpose of $ridGenerator?
Because, in my case, its value is null.
And in "transformBlockItemsToRemote", the "buildRemoteId" function of this variable is used. But the script is crashing because $ridGenerator is null.
Thanks,

Nicolas
Up

Nicolas Gommenginger

Member since:
10 November 2009

Posts: 17

Thursday 21 February 2013 3:59:07 pm

And when I try to sync a node with a layout field, I sometimes get this error:



Fatal error: Cannot use object of type eZPageBlockItem as array in extension/ezcontentstaging/classes/models/field.php on line 1128



Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Monday 25 February 2013 12:19:36 pm

The ridGenerator is supposed to be an object which takes care of generating remote-remoteId knowing local-id+local-remoteid.

This is needed because we have two possible configurations:
- same remote-id on both sides
- remote-ids are different (useful for syncing content to same server or complex cases)

You are right in that it seems that the code currently does not pass a valid ridGenerator to that field constructor.
Will check out if it ever worked in the past...

Principal Consultant International Business
Member of the Community Project Board

Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Monday 25 February 2013 12:20:22 pm

ps: what do you have exactly at line 1128?

Principal Consultant International Business
Member of the Community Project Board

Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Monday 25 February 2013 12:24:36 pm

It seems that when objects are sent, the ridgenerator is passed to the field by eZRestApiEmbeddedClientStagingTransport::encodeObject(), and as such should not be null.

Do you get that error souce-server side or target-server side?

Principal Consultant International Business
Member of the Community Project Board

Up

Nicolas Gommenginger

Member since:
10 November 2009

Posts: 17

Tuesday 26 February 2013 10:18:54 am

Hi,

I have this line 1128:



eZDebug::writeWarning( "Node {$item['node_id']} not found for staging export of an ezpage attribute, block " . $block->attribute( 'id' ), __METHOD__ );



I get this error on the source server when I try to sync an event with an ezflow layout field (but I don't always get the error...).
When I try to check the differences between the node on the source and on the target server (from the source server), I have:



Error while checking differences


Response received from server is not valid json. Decoding error: 4



This is due to the "$ridGenerator" variable that is null on the target server.

Nicolas
Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Tuesday 26 February 2013 10:57:17 am

Ok, line 1128 definitely has a (small) bug.

The correct code for building the error msg is:
"Node " . $item->attribute( 'node_id' ) . " not found for staging export of an ezpage attribute, block "


This error msg is only generated when an ezflow block points to a node which does not exist anymore. I'm not 100% sure whether this condition is normal (eg. it could happen if you add a node to a manual block, then delete the node), or if ezflow should be smart enough to never have in block definitions the ids of nodes which do not exist anymore...

In any case, what should happen is that the block gets ync'ed, but without the now-inexisting node in it. It is imho the more rational choice.

As for difference checking: you're right. When testing the layout attribute server-side, the ridGenerator is not injected, and a fatal error will probably ensue.

Guess I'll head over to Jira and open 2 bug reports...

Principal Consultant International Business
Member of the Community Project Board

Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Tuesday 26 February 2013 11:06:46 am

Principal Consultant International Business
Member of the Community Project Board

Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Tuesday 26 February 2013 11:08:23 am

Second: https://jira.ez.no/browse/EZP-20506. Pull-request will wait a bit longer, though

Principal Consultant International Business
Member of the Community Project Board

Up

BOUDAR EL MADANI

Member since:
22 May 2016

Posts: 1

Sunday 22 May 2016 12:28:31 pm

Hello

How did you finally settle this problem

eZDebug :: writeWarning ("Node {$ item [ 'node_id']} not found for staging export of ezpage an attribute, block

I had the same concern, the following message:

Response received from server is not valid json. Decoding error: 4

I thank you in advance.

cordially
Up

You need to be logged in to post messages in the forums. New users may register here.