Unable to add object to eZFlow Block after 4.1.0 Update

Author Message

Michael Fürst

Wednesday 18 March 2009 1:31:19 pm

Hi,

After updating to 4.1.0 I'm unable to add object to an eZFlow Block in Backend.
When I click on "Add Item", then select an article and add it, the block still is empty.
Other functions (like adding a block) work without any problem.

Has anyone an idea??

Thanks in advance,
regards,
Mike

Georg Franz

Wednesday 18 March 2009 3:27:41 pm

Hi,

probably this is related to this bug:
http://issues.ez.no/IssueView.php?Id=14485&activeItem=7

Best wishes,
Georg.

--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004

Michael Fürst

Thursday 19 March 2009 2:05:57 am

Hi Georg,

Nope, that fix doesn't work.
The first bug (i reported this one already some time ago) is fixed in the actual release. But the bug with adding objects to a block, is already there after adding your two lines of code.

In eZFlow Release 1.1-0 it's in Line ~724 of <b>/extensions/ezflow/datatypes/ezpage/ezpagetype.php.</b>

The Case now looks like this, but the problem isn't solved :(

case 'custom_attribute':
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );

                if ( !$http->hasPostVariable( 'BrowseCancelButton' ) )
                {
                    if ( $http->hasPostVariable( 'SelectedNodeIDArray' ) )
                    {
                        $selectedNodeIDArray = $http->postVariable ('SelectedNodeIDArray' );
                        $customAttributes[$params[3]] = $selectedNodeIDArray[0];
                    }

                    $block->setAttribute( 'custom_attributes', $customAttributes );
                    
                    // BUGFIX, related to http://issues.ez.no/IssueView.php?Id=14485&activeItem=7
                    $contentObjectAttribute->setContent($page);
					$contentObjectAttribute->store();
                    
                }
                break;

I think that is really a major bug for everyone who upgrades to eZPublish 4.1.0 and uses eZFlow, cause you are unable to publish content on frontpages...

I hope there will be a fix available as soon as possible or we can find another solution...

Maybe the error message "The total number of zones in the new layout is less than the number of zones in the previous layout. Therefore, you must map the previous zones to new zones. Unmapped zones will be removed!" in the zone view can help us!?

Ciao,
Mike

Michael Fürst

Thursday 19 March 2009 3:32:06 am

Ok, I'm debuging at the moment.
Whar I found out till now:
When you add a new item (object) to a block, the case tree "new_item" in the ezpagetype::customObjectAttributeHTTPAction method is called (not "custom_attribute")

Łukasz Serwatka

Thursday 19 March 2009 10:50:52 am

Hi Mike,

I have attached patch to the issue http://issues.ez.no/14485. The updated packages are online now, thus you can re-run upgrade script from 4.1. Remember about backup ;)

As the issue with adding items to block affecting only 1.1 series, the update for eZ Flow 1.0 will release with eZ Publish 4.0.4 where problem with custom attributes is resolved too.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Michael Fürst

Thursday 19 March 2009 2:06:14 pm

Hi Lukasz!

Great, bug is fixed and everything seems to work fine now!
Gratulations, really great work ;)

Thanks & Bye,
Mike

A Fowler

Friday 05 June 2009 8:16:17 pm

I found this thread by searching for the message "The total number of zones in the new layout is less than the number of zones in the previous layout. Therefore, you must map the previous zones to new zones. Unmapped zones will be removed!"

It doesn't look exactly like the same issue, but it could be related. I found that in my code, the two patches from http://issues.ez.no/14485 are already applied. (I have 4.1.1 and eZ Flow 1.1, I believe). So I can't figure out why I am seeing this error message.

Basically, when I edit the Home object, of class Frontpage, it always shows me the error message "The total number of zones in the new layout is less than the number of zones in the previous layout. Therefore, you must map the previous zones to new zones. Unmapped zones will be removed!" It does not show the tabs for the zones at all below that. No matter what I do, I cannot get past this. If I select a new layout, it doesn't remove the message. If I publish the object and go in to edit it again, I still see the message. If I discard the draft and edit again, it's still there. If I restore the database from a backup I made some time ago when I wasn't seeing this issue, I still see it now.

Looking at the page source, it seems that a bit of JavaScript is employed to put the tabs there for the different zones. But the script must not be running or completing properly, and I'm not yet skilled enough in JavaScript to figure out why.

My latest clue is that on the Error Console in Firefox, I see this:

"Error: YAHOO is not defined
Source File: http://admin.robinsonandlong.doesntexist.com:7456/extension/ezflow/design/standard/javascript/blocktools.js
Line: 1"

And the same error is repeated three more times with other files.

Any ideas how to fix this? Much appreciated!

Łukasz Serwatka

Saturday 06 June 2009 12:33:12 am

Did you read the eZ Flow setup guide[1]? It looks like you are missing a re-write rule:

^/extension/[^/]+/design/[^/]+/(stylesheets|flash|images|lib|javascripts?)/.* - [L]

[1] http://ez.no/doc/content/download/24948/102690/version/3/file/ezflow_setup-1.1.pdf

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

A Fowler

Wednesday 10 June 2009 12:59:47 pm

Thank you, I missed that. This seems to have fixed the problem!

The rewrite rule I had was:

^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]

Which I believe I copied from somewhere in the documentation on this site. The problem was that the "lib" directory, where the YUI code is located, was not included. The path "extension/ezflow/design/standard/lib/yui/2.6.0/build/utilities/utilities.js" was not loading, so the YAHOO variable was not getting initialized.

Your suggested rewrite rule fixed the problem.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.