Part of the EllisLab Network
   
 
multiple models loaded with auto-connect by passing TRUE (boolean) via the third parameter
Posted: 10 November 2006 07:05 AM   [ Ignore ]  
Summer Student
Total Posts:  16
Joined  06-12-2006

Rick,

In version 1.5.0.1 an error occured when loading multiple models (with the third parameter TRUE) from a controller.
Several other people also mentioned this bug.

Our PHP version is 5.1.2

I hope you can fix this problem, because the possiblity to load/specify a database per model is very handy.

I have made the following temporary Workaround for this moment:

In file Loader.php line 141:

$CI->load->database($db_conn, FALSE, TRUE);

comment this line and autoload library database.

Profile
 
 
Posted: 11 November 2006 03:10 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  2505
Joined  12-21-2001

What kind of error are you getting?

 Signature 
Profile
MSG
 
 
Posted: 13 November 2006 04:00 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  16
Joined  06-12-2006

Fatal error: Call to a member function select() on a non-object in content_model.php on line 83

class Content_model extends Model
{
    
    
function __construct()
    
{
        parent
::Model();
    
}

content_model line 83

$this->db->select(‘id, alias, title, content, version’ ) ;

Profile
 
 
Posted: 13 November 2006 06:02 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  481
Joined  03-08-2006

If you’ve autoloaded the database library, don’t pass the third parameter (True) when loading models. This has already been covered elsewhere in the forums.

 Signature 

Flickr | Last.fm | Del.icio.us

Profile
 
 
Posted: 13 November 2006 06:22 AM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  16
Joined  06-12-2006

Yes I know. But i don’t want to autoload the database library. I have models that don’t use a database.

Since 1.3.3 there is the possibility to load models without a database. A very good option. And now since version 1.5.0.1 this nice feature is not working anymore.

Profile
 
 
Posted: 12 December 2006 09:17 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  16
Joined  06-12-2006

Fixed in 1.5.0.2.
Thank you Rick.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 66415 Total Logged-in Users: 28
Total Topics: 84757 Total Anonymous Users: 0
Total Replies: 454865 Total Guests: 250
Total Posts: 539622    
Members ( View Memberlist )