ImpEx 1.74 "Only variables can be passed by reference" error in ImpexData.php Issue Tools
issueid=6175 Thu 15th Sep '05 5:13am
New Member
ImpEx 1.74 "Only variables can be passed by reference" error in ImpexData.php

I'm running PHP 5.0.5, vBulletin 3.0.9, ImpEx 1.74. When on "003 Import User Groups and Ranks", I got the following error:

Fatal error: Only variables can be passed by reference in /xxxxxxxxxx/ImpExData.php on line 159

I fixed it by changing the code from:

PHP Code:
        function ImpExData(&$Db_object, &$sessionobject$type)
        {
                
$this->_datatype=$type;
                
$this->_values $this->create_data_type(
                        
$Db_object,
                        
$sessionobject->get_session_var('targetdatabasetype'),
                        
$sessionobject->get_session_var('targettableprefix'),
                        
$type
                
); 
To:

PHP Code:
        function ImpExData(&$Db_object, &$sessionobject$type)
        {

                
$targetdatabasetype $sessionobject->get_session_var('targetdatabasetype');
                
$targettableprefix $sessionobject->get_session_var('targettableprefix');

                
$this->_datatype=$type;
                
$this->_values $this->create_data_type(
                        
$Db_object,
                        
$targetdatabasetype,
                        
$targettableprefix,
                        
$type
                
); 
I just wanted to share this in case anyone else has the same problem, and as a bugfix suggestion for future releases.
Issue Details
Project ImpEx
Category Unknown
Status Fixed (Closed)
Priority 6
Affected Version 3.0.x
Fixed Version Next Release
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)

Thu 15th Sep '05 7:40pm
vBulletin Developer
 
This is because php5 doesn't allow function paramaters that are declared as references to be passed in directly from a function call. A defined variable must be passed in.
Reply
Reply