Part of the EllisLab Network

Bug Report

mssql driver doesn’t have a CI object needed to use Input library

Date: 10/06/2008 Severity: Critical
Status: Resolved Reporter: krsanky
Version: 1.7.0 SVN
Keywords: Libraries, Database Class

Description

I update a working 1.6.3 site to svn.

I get an error:

Message: Undefined property: CI_DB_mssql_driver::$input

Filename: mssql/mssql_driver.php

Line Number: 217

I updated line 217 to add the ->CI before ->input.
Then that broke because the super class doesn’t setup a “CI” object.  I added the CI object to the super class, and everything worked again.

Code Sample

file DB_driver.php:
add "$this->CI =& get_instance();" to the constructor.

file mssql_driver:
change line 217 to this:
return
str_replace("'", "''",
$this->CI->input->_remove_invisible_characters($str));

Expected Result

page loads without error

Actual Result

page loads with error

Comment on Bug Report

Page 1 of 1 pages
Posted by: Rick Ellis on 6 October 2008 5:44pm
Rick Ellis's avatar

Thanks.  Fixed in SVN.

Posted by: krsanky on 6 October 2008 6:21pm
krsanky's avatar

You added the fix to mssql_driver.php , but not DB_driver.php ?

If I do a svn up I still get:
Message: Undefined property: CI_DB_mssql_driver::$CI

Filename: mssql/mssql_driver.php


If I add the CI object to the DB_driver.php constructor it works again.

Posted by: Rick Ellis on 6 October 2008 6:29pm
Rick Ellis's avatar

Whoops!  I assumed the object was already set in the main driver.  Fixed now…

Posted by: krsanky on 6 October 2008 6:37pm
krsanky's avatar

try again?

Message: Undefined variable: CI
Filename: mssql/mssql_driver.php

change:
$CI->get_instance();

to:
$CI =& get_instance();

Posted by: Rick Ellis on 6 October 2008 6:42pm
Rick Ellis's avatar

Oh man… time for me to step away from the computer…  grin

OK, fixed.

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?