Revision: 861
http://cs-project.svn.sourceforge.net/cs-project/?rev=861&view=rev
Author: crazedsanity
Date: 2008-03-30 14:52:11 -0700 (Sun, 30 Mar 2008)
Log Message:
-----------
Fix a logic error when retrieving record_id from an ancestry string with 0 parents.
FIXES ISSUE:::
#165: Fatal error retrieving tod records on issue with root-level ancestry
/lib/mainRecordClass.php:
* get_parent_from_ancestry():
-- extra check check so if there are no ":" characters in the ancestry
string, but $goBackLevels is 0 (given the ancestry string is numeric),
it will simply return the value of the given string.
-- NOTE: at present, this method will throw an exception if the final
return value isn't numeric.
Modified Paths:
--------------
trunk/1.2/lib/mainRecordClass.php
Modified: trunk/1.2/lib/mainRecordClass.php
===================================================================
--- trunk/1.2/lib/mainRecordClass.php 2008-03-30 06:25:40 UTC (rev 860)
+++ trunk/1.2/lib/mainRecordClass.php 2008-03-30 21:52:11 UTC (rev 861)
@@ -600,7 +600,14 @@
}
}
}
+ elseif(!preg_match('/:/', $ancestryString) && is_numeric($ancestryString)) {
+ $retval = $ancestryString;
+ }
+ if(!is_numeric($retval)) {
+ throw new exception(__METHOD__ .": failed to get ancestry from (". $ancestryString .")");
+ }
+
return($retval);
}//end get_parent_from_ancestry()
//=========================================================================
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|