[Vtigercrm-developers] Bug in the changeset #14217 - relating to the mysqli support
Prasad
prasad at vtiger.com
Sun Aug 24 06:06:53 GMT 2014
Istvan,
We have fixed it.
Regards,
Prasad
*Connect with us on: *Twitter <http://twitter.com/vtigercrm> *I* Facebook
<http://www.facebook.com/pages/vtiger/226866697333578?sk=wall> *I* Blog
<https://blogs.vtiger.com/>* I* Wiki
<http://wiki.vtiger.com/index.php/Main_Page> *I *Forums
<https://discussions.vtiger.com>*I* Website <https://www.vtiger.com/>
On Sun, Aug 24, 2014 at 2:11 AM, Holbok István <holbok at gmail.com> wrote:
> Hello Prasad,
>
> There is an serious bug in the changeset #14217 relating to the mysqli
> support.
> There was a change in \include\database\PearDatabase.php in function
> function disconnect().
> http://trac.vtiger.com/cgi-bin/trac.cgi/changeset/14217
>
> function disconnect() {
> $this->println("ADODB disconnect");
> if(isset($this->database)){
> if($this->dbType == "mysql"){
> mysql_close($this->database);
>
> * } else if($this->dbType=="mysqli"){
> mysqli_close($this->database);*
> } else {
> $this->database->disconnect();
> }
> unset($this->database);
> }
> }
>
> The red lines shows the added, new lines. The command *
> mysqli_close($this->database);* unfortunately wrong.
>
> The right command would be: according to the
> ...\libraries\adodb\drivers\adodb-mysqli.inc.php line ~ 669
> // returns true or false
> function _close()
> {
> @mysqli_close($this->_connectionID);
> $this->_connectionID = false;
> }
>
> ---------------------------
> *The right command* to close mysqli database is:
> *mysqli_close($this->database->_connectionID);*
>
> It really closes the database. The modification from the changeset #14217
> will not close the database but will give a worning:
> Warning: mysqli_close() expects parameter 1 to be mysqli, object given
> in ....\include\database\PearDatabase.php on line 875
>
> And in the debugging/developing settings, *vtiger *will echo this warning
> message even to the JSON output of Vtiger_Response(), so all AJAX responses
> could be broken. My AJAX in my CustomModule was broken and I hunted the
> cause for 2 days and I have found it in the above described.
>
> Note: Analogous to the mysqli, may the mysql_close($this->database) would
> be also wrong.
>
> Kindest regards:
> Istvan
>
>
> --
> üdvözlettel:
>
> *Holbok István*
>
> +3670-342-0900
> *e-mail:* holbok at gmail.com
> *SkyPe:* holboki
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140824/32c4cd60/attachment.html>
More information about the vtigercrm-developers
mailing list