Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.1.3

Bug #16560 Error message while creating the table browser
Submitted: 2009-09-01 16:44 UTC
From: apyth Assigned: tewolde
Status: Closed Package: MDB2_TableBrowser
PHP Version: 5.2.5 OS: Windows XP SP2
Roadmaps: (Not assigned)    
Subscription  


 [2009-09-01 16:44 UTC] apyth (AurĂ©lien Thion)
Description: ------------ Using the table browser result in an error notice (see below). Fortunately, the code still works. It can be fixed by changing line 83 of TableValidator.php : $this->currentTable = self::$tableRegistry[$tbl_name]; by $this->currentTable = self::$tableRegistry[$tableName]; Test script: --------------- <?php $mdb2 = MDB2::factory($dsn) ; $mdb2->loadModule('TableBrowser'); $browser = $mdb2->tableBrowserFactory('TBL_PART', 'NUMPART') ; if(PEAR::isError($mdb2)) die($mdb2->getMessage()) ; $browser->addFilter('CRM', 'NUMPART', '=', 1) ; $line = $browser->getRow(MDB2_FETCHMODE_ASSOC) ; $theCRM = new Partner(FALSE, $line) ; $browser->resetFilters() ; if(PEAR::isError($browser)) die($browser->getMessage()) ; var_dump($theCRM) ; ?> Expected result: ---------------- object(Partner)#17 (6) { ["numpart:private"]=> NULL ["nompart:private"]=> string(11) "LOLCATS WTF" ["adrpart:private"]=> string(23) "Fucksville, Middle-West" ["contact:private"]=> string(15) "Ding Dong Daddy" ["dao:private"]=> object(DAO_Partner)#16 (5) { ["hasKey:protected"]=> bool(true) ["key:protected"]=> string(7) "numpart" ["dsn:protected"]=> string(38) "mysqli://root@tcp+localhost:3306/bddev" ["table:protected"]=> string(14) "TBL_PART" ["typeUdpate:protected"]=> NULL } ["numemp"]=> int(2) } Actual result: -------------- Notice: Undefined variable: tbl_name in C:\wamp\bin\php\php5.2.9-2\PEAR\MDB2\TableBrowser\TableValidator.php on line 83 Notice: Undefined index: in C:\wamp\bin\php\php5.2.9-2\PEAR\MDB2\TableBrowser\TableValidator.php on line 83 object(Partner)#17 (6) { ["numpart:private"]=> NULL ["nompart:private"]=> string(11) "LOLCATS WTF" ["adrpart:private"]=> string(23) "Fucksville, Middle-West" ["contact:private"]=> string(15) "Ding Dong Daddy" ["dao:private"]=> object(DAO_Partner)#16 (5) { ["hasKey:protected"]=> bool(true) ["key:protected"]=> string(7) "numpart" ["dsn:protected"]=> string(38) "mysqli://root@tcp+localhost:3306/bddev" ["table:protected"]=> string(14) "TBL_PART" ["typeUdpate:protected"]=> NULL } ["numemp"]=> int(2) }

Comments

 [2009-09-02 13:44 UTC] cweiske (Christian Weiske)
 [2009-09-06 07:38 UTC] tewolde (Isaac Tewolde)
-Status: Verified +Status: Closed -Assigned To: +Assigned To: tewolde
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/