Forums / Developer / language in workflow event
Rainer Scharinger
Friday 06 February 2009 2:01:16 am
Hi,
I have a multi language site and I want do trigger a workflow event on 'publish after'. In this event I need the language of the currently published object.
Is there a way to get this language without parsing the URL?
Regards
Ćukasz Serwatka
Friday 06 February 2009 3:36:30 am
You can get that information on object level:
Quick example:
$parameters = $process->attribute( 'parameter_list' ); $object = eZContentObject::fetch( $parameters['object_id'] ); $object->attribute('current_language');
See http://ez.no/doc/ez_publish/technical_manual/4_0/reference/objects/ezcontentobjectfor attribute list.
Personal website -> http://serwatka.net Blog (about eZ Publish) -> http://serwatka.net/blog
Tuesday 10 February 2009 7:09:48 am
thx for the fast reply. Unfortunately is does not work.
$parameters = $process->attribute( 'parameter_list' ); $object = eZContentObject::fetch( $parameters['object_id'] ); $language = $object->attribute('current_language');
$language always contains the language of the first translation and not the language of the published translation.
Is this a bug, or is something wrong with the code?
I also have tried
$language = $object->currentLanguage;
with the same result