Forums / Developer / language in workflow event

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

language in workflow event

Author Message

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

Hi,

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/ezcontentobject
for attribute list.

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

Rainer Scharinger

Tuesday 10 February 2009 7:09:48 am

Hi,

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

Regards