Bug in mysqli after 3.4.7 update

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
User avatar
fatica
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 153
Joined: Fri Jan 19, 2007 10:32 pm
Contact:

Bug in mysqli after 3.4.7 update

Post by fatica » Tue Dec 22, 2015 3:04 am

Our custom component's data import process broke after applying this update. I'm not clear yet on the call stack yet, but this was the final error:

2015/12/22 02:57:19 [error] 1828#0: *4119570 FastCGI sent in stderr: "PHP message: PHP Fatal error: Call to a member function stat() on a non-object in /<redacted>/joomla/database/driver/mysqli.php on line 202" while reading response header from upstream, client:

That line references this:

Code: Select all

		if ($this->connection->stat() !== false)
Which used to be this:

Code: Select all

// Close the connection.
		if ($this->connection)
		{
			foreach ($this->disconnectHandlers as $h)
			{
				call_user_func_array($h, array( &$this));
			}

			mysqli_close($this->connection);
		}

		$this->connection = null;
I realize this isn't a very helpful report, but I wanted to bring this up asap since we've never seen any issue like this after a joomla upgrade, and we've been applying them faithfully for many years.

I'll get a full stack trace after I run this at work tomorrow.

The new code presumes that a connection object exists, and has a ->stat() function to call, which isn't the most defensive programming I've ever seen ;-)

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 24982
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Bug in mysqli after 3.4.7 update

Post by pe7er » Tue Dec 22, 2015 7:52 am

Maybe your issue is related with this known Backward Compatibility issue in Joomla 3.4.7?
https://docs.joomla.org/J3.x:Backward_C ... omla_3.4.7
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

User avatar
pollen8
Joomla! Explorer
Joomla! Explorer
Posts: 350
Joined: Wed Aug 17, 2005 10:32 pm
Location: la Rochelle - France
Contact:

Re: Bug in mysqli after 3.4.7 update

Post by pollen8 » Tue Dec 22, 2015 1:54 pm

a quick fix for that line is to replace it with:

Code: Select all

if ($this->connection && $this->connection->stat() !== false)
aka

User avatar
pollen8
Joomla! Explorer
Joomla! Explorer
Posts: 350
Joined: Wed Aug 17, 2005 10:32 pm
Location: la Rochelle - France
Contact:

Re: Bug in mysqli after 3.4.7 update

Post by pollen8 » Tue Dec 22, 2015 1:56 pm

A ticket is already up in JIssues, so if you can report there that you have the same issue we can move forward with fixing it:
https://issues.joomla.org/tracker/joomla-cms/8762
aka


Locked

Return to “Joomla! 3.x Bug Reporting”