2 blueyed Dec 08, 2006 00:58

i tried 1.9.1 beta and got this error so i upload an older version 1.8.6 and still get the error
I changed the code now i get this
Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/theyaren/public_html/b2evolution2/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 528
In 1.9.1 line 121 should say:
"return $obj".
in the following method:
/**
* TODO
*/
function & new_obj( $row = NULL )
{
$objtype = $this->objtype;
// Instantiate a custom object
$obj = new $objtype( $row ); // COPY !!
return $obj;
}
Please add the following code before it:
pre_dump($objtype, $row, $obj);
echo debug_get_backtrace();
and try it again. Please report back what it outputs, before the first "Notice: Only variable references should be returned by reference".
What PHP version are you using?
Do you get this on every admin page? Or after logging in?
Installation worked out ok? (I'm asking because of the forum section you've posted in).
Please try to be as verbose as possible, so I can reproduce/fix this.
A possible fix might be to add a "&" to the line which creates the object:
$obj = & new $objtype( $row );
I get the line 121 error on all the pages of the blog
I added
pre_dump($objtype, $row, $obj);
echo debug_get_backtrace();
before
return $obj;
and the page does not work at all it just displays codes...
Yeah.. :/
Indeed, this was expected.
You may re-read my post.. and maybe answer the questions therein, too.
adding
$obj = & new $objtype( $row );
worked thanks for the help
PLEASE tell me/us (at least) which PHP version you're using!
(also the other info would have helped).
Hi,
I had the same problem and posted a question: http://forums.b2evolution.net/viewtopic.php?p=48912#48912. After my post I found this solution. I posted in the Installation problems section of this forum because it occured after upgrading from 1.8.6 to 1.9.1 (and before; I tried a clean install of 1.9.1 before I installed 1.8.6)
Changing line 119 in:
$obj = & new $objtype( $row );
resolved the problem.
My host runs PHP 4.4.0 and MySQL 4.1.11-Debian_4sarge5
It would be great if someone could try the patched file from http://forums.b2evolution.net//viewtopic.php?p=51480#51480 - but I believe it's a Zend Optimizer bug instead.
Is everybody experiencing this also using (an old version of) Zend Optimizer? You can see this in a phpinfo() page.
Thanks Blueyed,
I 'solved' the problem by putting this line on top:
<?php
error_reporting(0);
It's a bit rude, but it got rid of the warnings.
I have tried your patch (other post in this message board) and didn't find any errors yet.
This is a PHP /Zend problem. When I was experiencing this problem I found a post on another board (I believe it was the bug reporting section of php.net). The warning was intentionally included in PHP, but users suggested it to be redundant ("even C++ doesn't give the warning"). In later versions of PHP this is corrected. The PHP versions affected are 4.4.0 through early versions of 5.
You suggested it to be a Zend optimizer problem. It may well be. My Zend optimizer version in phpinfo() reads:
Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with the ionCube PHP Loader v3.1.22, Copyright (c) 2002-2006, by ionCube Ltd., and with Zend Extension Manager v1.0.8, Copyright (c) 2003-2005, by Zend Technologies with [b]Zend Optimizer v2.5.10[/b], Copyright (c) 1998-2005, by Zend Technologies
If I do experience warnings with the patch I will report them here.
error_reporting(0) is really rude.. try error_reporting(E_ALL & ~E_NOTICE) instead - which just suppresses notices.
To really test if the patched file prevents the errors you need to use error_reporting(E_ALL) of course.
If you have access to your error log files I'd recommend using error_reporting=E_ALL and display_errors=off - this way they won't get displayed, but logged.
blueyed wrote:
error_reporting(0) is really rude..
Well, yes, but why should you annoy your viewers with any error at all? I found this suggestion: (error_reporting=(0) on *every* php page you publish) somewhere on the net. Makes some sense.
I put your patch up as it is, so no surpressed error notices. And no warnings yet.
Thanks, this helped me as well.
Tejaaa
tejaaa, what helped you?
"""$obj = & new $objtype( $row );""" or the patch I've referred to?
NOTE: this problem cannot be fixed if I don't know how to fix this best!
tejaaa, are you using Zend Optimizer? Which version? Which PHP version?
Sorry, I'm really (getting) tired of this. Thanks for the initial feedback though..
Blueyed, sorry for the late response.
Me changing the line of 119 helped. I tried your patch but that did not help me and was getting same errors as before.
My version of PHP is 4.4.4 & Zend Optimizer v2.5.10. I Hope that helps.
Now here are other errors that I found. When we go to a individual blog post, on the top of the page I get the error as below
Notice: Only variable references should be returned by reference in /home/itejas2/public_html/inc/MODEL/collections/_blogcache.class.php on line 179
And also just before the comments start I see the following errors.
Notice: Undefined variable: disp_trackbacks in /home/itejas2/public_html/skins/_feedback.php on line 64
Notice: Undefined variable: disp_pingbacks in /home/itejas2/public_html/skins/_feedback.php on line 70
Notice: Undefined variable: disp_trackback_url in /home/itejas2/public_html/skins/_feedback.php on line 77
I hope you or someone else here can help me resolve the issue.
One more important thing which might not be related to this problem. When I go to individual post in IE 7, I don't see any skin colors and formatting goes missing but it works fine in Firefox
Thanks,
Tejaaa
this is my problem
My b2evolution Version: 1.9.x
mysql version : 4.1.11-Debian_4sarge7
php version :4.4.0
b2evo 1.9.2
----------------------------------------------
I get this error in the admin page
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Warning: Cannot modify header information - headers already sent by (output started at /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php:121) in /home/www/hardblogcafe.freehostia.com/inc/VIEW/_menutop.php on line 39
--------------------
This errors in the blog:
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Warning: Cannot modify header information - headers already sent by (output started at /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php:121) in /home/www/hardblogcafe.freehostia.com/inc/MODEL/skins/_skin.funcs.php on line 71
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
-----
it fixed in this way:
changing line 121 from
$obj = new $objtype( $row ); // COPY !!
to
$obj = & new $objtype( $row ); // COPY !!
-------------------------------------------
now i've another problem:
1)when i delete the example posts in the backoffice i get this error:
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectlist2.class.php on line 130
2)at the end of the post in the blog i get this:
Notice: Only variable references should be returned by reference in /home/www/hardblogcafe.freehostia.com/inc/MODEL/dataobjects/_dataobjectlist.class.php on line 111
------
Apache 1.3.33, PHP 4.4.0 and MySQL 4.1.11-Debian_4sarge7
i don't know the Zend Optimizer versíon becouse when i click on php info i get a blank page :(
however the host is freehostia.com
Just upgraded from 0.9.2 to 1.9.3
Here is my error message when logging into admin tool
Notice: Only variable references should be returned by reference in /home/dophan2/public_html/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/dophan2/public_html/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/dophan2/public_html/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/dophan2/public_html/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/dophan2/public_html/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/dophan2/public_html/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/dophan2/public_html/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/dophan2/public_html/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Notice: Only variable references should be returned by reference in /home/dophan2/public_html/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Warning: Cannot modify header information - headers already sent by (output started at /home/dophan2/public_html/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php:121) in /home/dophan2/public_html/blogs/inc/VIEW/_menutop.php on line 39
I use:
PHP Version 4.4.4
and
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.8, Copyright (c) 2003-2005, by Zend Technologies with Zend Optimizer v2.5.10, Copyright (c) 1998-2005, by Zend Technologies
Will reload my previous version 0.9.2 until problem is fixed
Using php 4.4.1, mySQL mysql Ver 14.12 Distrib 5.0.24.
I have a test install of 1.9.3 (upgraded from 1.9.2) at digitalvideoexperts.com/health.
This:
$obj = & new $objtype( $row );
got rid of most of the errors.
I still get an error in the comment section of an individual post:
Notice: Only variable references should be returned by reference in /home/digitalv/public_html/health/inc/MODEL/dataobjects/_dataobjectlist.class.php on line 111
I don't know exactly which one line 111 is but this is the general area:
if( $this->current_idx >= $this->result_num_rows )
{ // No more comment in list
$r = false;
return $r;
Probably my last comment on this issue(s):
this is very likely a Zend Optimizer Bug. AFAIK version 3.x of Zend Optimizer is available and should fix this.
I followed all the above described steps, and it gave this reply to me:
Notice: Only variable references should be returned by reference in /home/www/filebit.freehostia.com/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Warning: Cannot modify header information - headers already sent by (output started at /home/www/filebit.freehostia.com/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php:121) in /home/www/filebit.freehostia.com/blogs/inc/VIEW/_menutop.php on line 39
Then I try to enter in some session that this below of this is returns me this reply:
Notice: Only variable references should be returned by reference in /home/www/filebit.freehostia.com/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 122
An unexpected error has occured!
If this error persits, please report it to the administrator.
Go back to home page
Additional information about this error:
Requested User does not exist!
of line 120 until the 122 I have this:
$obj = & new $objtype( $row ); // COPY !!
}
some suggestion? I am thinking about installing the first version to see the same if of bug, the version
1.8.7 "Tokyo" 2007-01-22 Stable 2168 kB
if I to try to delet everything, also the data base, and to install this version, improves?
please, help me...
Summary of the changes I have made, to avoid error messages.
File: _dataobjectcache.class.php
Edit line 119 to: $obj = & new $objtype( $row );
File: _dataobjectlist2.class.php
Edit line 129 to: $r = false;
Edit line 130 to: $temp = & $r;
Edit line 131 to: return $temp;
File: _dataobjectlist.class.php
Edit line 110 to: $r = false;
Edit line 111 to: $temp = & $r;
Edit line 112 to: return $temp;
File: _genericcache.class.php
Edit line 65 to: $obj = & new $objtype( $row );
File: _adminUI_general.class.php
Edit line 776 to: $r = false;
Edit line 777 to: $temp = & $r;
Edit line 778 to: return $temp;
File: _filelist.class.php
Edit line 845 to: $r = false;
Edit line 846 to: $temp = & $r;
Edit line 847 to: return $temp;
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 98304 bytes) in C:\wamp\www\b2evolution\blogs\inc\MODEL\items\_itemlist2.class.php on line 1012
zhenchang wrote:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 98304 bytes) in C:\wamp\www\b2evolution\blogs\inc\MODEL\items\_itemlist2.class.php on line 1012
This is probably not related; your memory seems to have bumped to the max after changing some lines. In order to correct try in config->_basic_config.php:
ini_set('memory_limit', '12M');
or in .htaccess in the root of your server (and if not there, then somewhere else or use the sample.htacces that comes with the B2evo installation):
# Increase memory limit
php_value memory_limit 12M
.
If these options don't work then it looks like your host doesn't allow you to change the standard php settings. You'd better contact the helpdesk of your host.
Good luck
Adding the bit of code $obj = & new $objtype( $row ); into to line 119 solved the problem. It looks beautiful now. I am running:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.8, Copyright (c) 2003-2005, by Zend Technologies with Zend Optimizer v2.5.10, Copyright (c) 1998-2005, by Zend Technologies
PHP version4.4.1
Thanks to whomever came up with this.
virtualdave
I changed line 121 to:
$obj = & new $objtype( $row );
and that worked perfect for now.
edb :lol:
Ok, I am going to probably look pretty dumb, but...
How do I identify line 119 or 121. What is already there if I am changing it to $obj = & new $objtype( $row) ?
I am not a programmer of any kind. I am just trying to get rid of the (mutter, mutter) errors shown below.
Notice: Only variable references should be returned by reference in /home/polymerc/public_html/workbench/b2evolution/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line 121
Warning: Cannot modify header information - headers already sent by (output started at /home/polymerc/public_html/workbench/b2evolution/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php:121) in /home/polymerc/public_html/workbench/b2evolution/blogs/default.php on line 28
Thanks folks,
Meche
Meche wrote:
How do I identify line 119 or 121. What is already there if I am changing it to $obj = & new $objtype( $row) ?
I am not a programmer of any kind. I am just trying to get rid of the (mutter, mutter) errors shown below.
Thanks folks,
Meche
Hi Meche,
Use a code editor like [url=http://notepad-plus.sourceforge.net/nl/site.htm]Notepad++[/url] that has line numbers before the lines.
The lines you want to change are very similar to the examples, like:
$obj = new $objtype( $row)
and
$r = false;
return $r;
Good luck
Still getting error "Only variable references..." in /inc/items/model/_itemlist.class.php and the line referenced is the last line here:
function & get_item()
{
if( $this->group_by_cat == 1 )
{
$this->group_by_cat = 2;
return $this->current_Obj;
}
$Item = & parent::get_next();
if( !empty($Item) && $this->group_by_cat == 2 && $Item->main_cat_ID != $this->main_cat_ID )
{
$this->group_by_cat == 0; // For info only.
$r = false;
$temp = & $r;
return $temp;
}
return $Item; //This is the line causing the error
}
Has anyone else run into this and found a solution? Thank you!
So, I've been trying to solve all the errors and they just keep popping up, so finally, I did the old:
error_reporting( E_ALL ^E_NOTICE );
but is that safe? Don't those error messages mean something isn't functioning correctly somewhere? Or will I most likely never notice a problem?
Down to only 2 errors on the sample bolgs, any assistance would be appreciated... the first
Notice: Only variable references should be returned by reference in /home/endle6/public_html/inc/items/model/_itemlistlight.class.php on line 1215
The code looks like:
if( !empty($Item) && $this->group_by_cat == 2 && $Item->main_cat_ID != $this->main_cat_ID )
{ // We have just hit a new category!
$this->group_by_cat == 0; // For info only.
$r = false;
return $r;
}
//pre_dump( $Item );
return $Item;
Line 1215 being the... return $Item;
Second error reads:
Notice: Only variable references should be returned by reference in /home/endle6/public_html/inc/items/model/_itemlist.class.php on line 298
It's basically the same code as the other line... thanks in advance
Website is endlesschatter.com
Hi Tutor,
Welcome to the forums.
The first error, make that:
//pre_dump( $Item);
$temp = & $item;
return $temp;
I think this works, but please do check. I can't debug this.
Good luck
Zend PHP 5 Certification Study Guide wrote:
Referencing Variables
By default, assignment operators work by value—that is, they copy the value of an
expression on to another. If the right-hand operand happens to be a variable, only
its value is copied, so that any subsequent change to the left-hand operator is not
reflected in the right-hand one. For example:
$a = 10; $b = $a; $b = 20; echo $a; // Outputs 10
Naturally, you expect this to be the case, but there are circumstances in which you
may want an assignment to take place by reference, so that the left-hand operand
becomes “connected” with the right-hand one:
$a = 10; $b = &$a; // by reference $b = 20; echo $a; // Outputs 20
That did correct the first error, thanks a lot Afwas!
The second error:
Notice: Only variable references should be returned by reference in /home/endle6/public_html/inc/items/model/_itemlist.class.php on line 298
Still remains. It's at the bottom of the page. I attempted to use the same two lines of code for it (the php looks the same for line 298) but all comments are removed from the blog if it is used.
Again thanks for the response.
Tutor
Which b2evo version are you using?
To fix it, in /home/theyaren/public_html/b2evolution2/blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php on line "121" there's probably a "return false;". Change it to
It there's "return true;" instead, change the first line in the code above to "$r = true;" (I hope you get the idea).
Anyway, only with the b2evo version you're refering to I can really look this up.