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.

eZ debug

Timing: Jan 18 2025 05:01:53
Script start
Timing: Jan 18 2025 05:01:53
Module start 'layout'
Timing: Jan 18 2025 05:01:53
Module start 'content'
Timing: Jan 18 2025 05:01:53
Module end 'content'
Timing: Jan 18 2025 05:01:53
Script end

Main resources:

Total runtime0.0273 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.8203152.6875
Module start 'layout' 0.00600.0043 742.507839.5234
Module start 'content' 0.01030.0146 782.031393.6484
Module end 'content' 0.02480.0024 875.679734.3047
Script end 0.0272  909.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00279.9893140.0002
Check MTime0.00114.0206140.0001
Mysql Total
Database connection0.00124.557210.0012
Mysqli_queries0.003512.863230.0012
Looping result0.00000.091810.0000
Template Total0.00196.810.0019
Template load0.00103.820410.0010
Template processing0.00082.965610.0008
Override
Cache load0.00072.408010.0007
General
dbfile0.004014.669880.0005
String conversion0.00000.033240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs