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

Request #13674 Improve error codes
Submitted: 2008-04-14 10:02 UTC
From: jerry1970 Assigned: kguest
Status: Closed Package: Genealogy_Gedcom (version 1.0.0)
PHP Version: 5.2.5 OS:
Roadmaps: 1.0.1    
Subscription  


 [2008-04-14 10:02 UTC] jerry1970 (Jerry Van Kooten)
Description: ------------ The function _tag contains this comment: * @return integer tag id or 20 (force error) and this code: for ($i=0; $i < count($tab); $i++) { if (@preg_match('/'.$tag.'/US', $tab[$i])) return $i; } return 20; This is very very silly as many Gedcom individuals have more than 20 lines! Any individual fact that is not found (for example, no NICK has been entered) results in the value from the 20th line of the Gedcom individual's record. I changed the last line to this: return -1; // used to be 20! And in function _contTag, I changed this line: if ($i === 20) { to this: if ($i === -1) { And everything works as would be expected.

Comments

 [2008-09-21 17:17 UTC] kguest (Ken Guest)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.