How to retrieve parent node id from an unpublished object?

Author Message

Andrea Sudetti

Monday 28 September 2009 3:47:57 am

Hi all,
I have to validate an input during public processing, but I'm not able to retrieve the parent node id of the object submitted before it is published (after submit, I've to check some conditions referring to parent node) ... I know that the node doesn't exist until the object is published but I guess that the parent node id MUST be available...

The question is: how can I retrieve the parent node id inside function validateInput in my custom edit module handler?

I watch in $_SESSION e $_POST variables but the only parent reference is the "redirectURIafterpublish" variable... I can't believe is the only way to get back the parent id...

Suggestions?

Thankyou in advance...

Gaetano Giunta

Monday 28 September 2009 4:19:28 am

Try this:

eZNodeAssignment::fetchForObject( $objectId, $object->attribute( "current_version" ) );

Principal Consultant International Business
Member of the Community Project Board

Andrea Sudetti

Monday 28 September 2009 5:47:59 am

Yessss! Just what I needed!

Thank you mate!

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