From: Don S. <ri...@us...> - 2004-09-13 19:43:41
|
Update of /cvsroot/phpwsbb/phpwsbb/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3380/class Modified Files: Forum.php Log Message: These fields can't be null in DB, but are null when adding new forums. To get around it I'm just setting them for now Index: Forum.php =================================================================== RCS file: /cvsroot/phpwsbb/phpwsbb/class/Forum.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Forum.php 13 Sep 2004 18:17:20 -0000 1.25 --- Forum.php 13 Sep 2004 19:43:31 -0000 1.26 *************** *** 271,274 **** --- 271,287 ---- } + /* Hacks to get around some of Eloi's DDL */ + if (empty($this->_posts)) + $this->_posts = 0; + + if (empty($this->_lastpost_topic_label)) + $this->_lastpost_topic_label = ""; + + if (empty($this->_lastpost_topic_id)) + $this->_lastpost_topic_id = 0; + + if (empty($this->_lastpost_post_id)) + $this->_lastpost_post_id = 0; + $error = $this->commit(); if(PHPWS_Error::isError($error)) { *************** *** 301,304 **** --- 314,319 ---- $this->_threads = $t['COUNT(id)']; $this->_posts = $t['SUM(replies)']; + if (empty($this->_posts)) + $this->_posts = 0; $sql = "SELECT id FROM " . $GLOBALS["core"]->tbl_prefix . "mod_phpwsbb_threads WHERE fid=" . $this->getId() . " ORDER BY lastpost DESC"; |