This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » Developer » Forums and Workflow

Forums and Workflow

Forums and Workflow

Wednesday 09 April 2003 3:36:34 pm - 4 replies

We are developing a forum site and we notice that when you post forms as an anonymous user with 'Approve' workflow enabled the default code causes problems.

To fix this we changed the code in kernel/content/edit.php line 226 from:
$module->redirectToView( 'view', array( 'sitemap', 2 ) );
$module->redirectToView( 'view', array( 'full', 144 ) );
This then directs to a set page that the anonymous user to a page they have access too.

The problem is that the node_id does is not available with workflow enabled so the page redirects to sitemap/2, this is not an allowed location, and eZ quite rightly asks for a login. This is not nice.

Can you please let me know if you can get the forms to post correctly with workflow enabled? Is thhere something we are missing? Does it need fixing?

Wednesday 09 April 2003 7:34:15 pm

Just to clarify this. The problem seems to be with the $node that gets assigned on line 202. It appears that $node is null and then the script redirects to the 'error' sitemap location.

Initial impressions are that the node is null because it has yet to be created. It will be created when the post is approved but this doesn't help with the redirect which will occur before that action takes place. Maybe the code should check the workflow requests?

Another point is that this code doesn't seem to respect the settings within site.ini.php where the default and error pages are defined.

Hope this helps


Friday 11 April 2003 4:11:18 pm

If I understood you write you should change line 226 in edit.php to:

$module->redirectToView( 'view', array( 'full', $version->attribute( 'main_parent_node_id' ) ) );

In that case behavour of system will be the same with approval workflow as it is without it.


Friday 11 April 2003 4:20:02 pm

Perfect... that just what we needed...
Is this going into the main 3.0 stable branch or do we need to keep a local patch?

Friday 11 April 2003 5:10:32 pm

I think I will commit it to stable.


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

36 542 Users on board!

Forums menu

Proudly Developed with from