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 » Extensions » Selling Pay-Per-Download trouble...

Selling Pay-Per-Download trouble after uploading to eZP 2011.11

Selling Pay-Per-Download trouble after uploading to eZP 2011.11

Sunday 18 December 2011 11:04:02 pm - 3 replies


I used the «Pay-Per-Download» extension from Peter Keung with eZ Publish 4.3 and il worked well.

Now I've done an upgrade to eZ Publish 2011.11 I meet this error message:

Fatal error: Call to undefined function ezi18n() in  /home/xxxxx/public_html/extension/payperdownload/eventtypes/event/payperdownload/payperdownloadtype.php  on line 8
Fatal error: eZ Publish did not finish its request
The execution of eZ Publish was abruptly ended, debug information can be  found in the log files normally placed in var/log/* or by enabling  'DebugOutput'

The line 8 of payperdownloadtype.php is:

6 public function __construct()
7     {   
8         parent::__construct( self::WORKFLOW_TYPE_STRING, ezi18n( 'kernel/workflow/event', 'Pay Per Download' ) );
9         $this->setTriggerTypes( array( 'shop' => array( 'checkout' => array( 'before' ) ) ) );
10     }

and there is no specifics logs in /var/log/error.log

These error lines are displayed, for example, each time I click on the link «Trigger» in the left menu of the Setup tab.

Any help is welcome.


Sunday 18 December 2011 11:22:37 pm

Hello Pascal,


Remember that the 'ezi18n' function was deprecated and removed in eZ Publish 4.3 (I seem to remember).

Quote from above link ...

ezi18n() and ezx18n() functions has been deprecated in favor of new ezpI18n::tr()
function that takes advantage of autoloading so you don't need to require_once
the i18n.php file. These two function will be removed in a future version.


So it's important to remember from 4.3+ you should use 'ezpI18n::tr()' function instead within your custom workflow event and other extension PHP code.


This was also commented on in the site content,

And some have used creative solutions to avoid using the new syntax, though while I do share this information also I strongly urge to use the new syntax instead of trying to retain the older syntax.

We are now several years away from this code being deprecated and removed from eZ Publish entirely. Best to update your code to support the latest community build available!


You'll need to edit your copy of the workflow event in question and and make these PHP code changes yourself, though this by it'self is not hard to do or very time consuming. Best wishes!


I hope this helps ...




Modified on Sunday 18 December 2011 11:28:01 pm by // Heath

Monday 19 December 2011 11:10:17 pm

Thanks a lot Heath !

Your explanations are clear and the solution seems to be what you suggest: replace "ezi18n" by "ezpI18n::tr".

I did it in payperdownloadtype.php (which is the only place of the extension where "ezi18n" is used), I activated the extension and reloaded the autoload table. As a result, no more error message when I click on «Tiggers» in the Setup tab.

I tested the operation of the extension and it works fine



Tuesday 20 December 2011 2:07:55 am

Hello Pascal,


Your very welcome. I'm happy to be able to help you solve this breakdown.


Take care!





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

36 542 Users on board!

Forums menu

Proudly Developed with from