error message getting as Only variables should be assigned by reference

Author Message

Romeo Antony

Monday 13 September 2010 2:42:02 pm

Hi,

I was trying to study the custom extension development from ezsite, from following tutorial

http://ez.no/ezpublish/documentation/development/extensions/module/module_tutorial_part_1

But , when try the same code in that tutorial ,

getting an error message as

The execution of eZ Publish was abruptly ended. Contact website owner with current url and what you did, and owner will be able to debug the issue further.

Only variables should be assigned by reference in list.php line22

Here in the line.php file ,

to get the template object there is code like this

$tpl=& templateInit();

I think from this line error is generated.Do anyone have any any idea what is wrong with this error message , please give a help

Romeo

Heath

Monday 13 September 2010 9:05:56 pm

Hello Romeo,

That tutorial you mention is very old and contains example api calls which are long ago deprecated.

What version of eZ Publish are you using? In eZ Publish 4.3 templateInit() has been deprecated, so in the future calls to to get template instance should use this replacement instead:

eZTemplate::factory()

Cheers,

Heath

See: http://share.ez.no/forums/discussions/ez-publish-4.3.0-released

http://share.ez.no/forums/extensions/modules-fetching-templates-problems-with-4.3

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Romeo Antony

Tuesday 14 September 2010 2:56:48 am

Thank you for your reply Heath. Yes you are correct.I am using ez 4.3.0 . As you mentioned ,templateInit() has been deprecated.

So I should use

eZTemplate::factory()

So I have replaced $tpl =& templateInit(); by $tpl= eZTemplate::factory()

Is this is what you mean

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