[pLog-svn] r2980 - in plog/trunk/class: action dao
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Wed Feb 22 17:25:41 GMT 2006
Author: oscar
Date: 2006-02-22 17:25:40 +0000 (Wed, 22 Feb 2006)
New Revision: 2980
Modified:
plog/trunk/class/action/viewarticleaction.class.php
plog/trunk/class/dao/articles.class.php
Log:
solved an issue where the article sometimes wouldn't be found because of the maxDate parameter.
Modified: plog/trunk/class/action/viewarticleaction.class.php
===================================================================
--- plog/trunk/class/action/viewarticleaction.class.php 2006-02-22 17:13:27 UTC (rev 2979)
+++ plog/trunk/class/action/viewarticleaction.class.php 2006-02-22 17:25:40 UTC (rev 2980)
@@ -45,6 +45,7 @@
$adjustedDates = $this->_getCorrectedDatePeriod( $this->_date );
$this->_date = $adjustedDates["adjustedDate"];
$this->_maxDate = $adjustedDates["maxDate"];
+ if( $this->_maxDate == -1 ) $this->_maxDate = 0;
return true;
}
@@ -197,7 +198,7 @@
// if the article id doesn't exist, cancel the whole thing...
if( !$article ) {
- $this->_setErrorView();
+ $this->_setErrorView();
return false;
}
Modified: plog/trunk/class/dao/articles.class.php
===================================================================
--- plog/trunk/class/dao/articles.class.php 2006-02-22 17:13:27 UTC (rev 2979)
+++ plog/trunk/class/dao/articles.class.php 2006-02-22 17:25:40 UTC (rev 2980)
@@ -121,9 +121,6 @@
* if there're more than one article with the same title, you will
* always get only one of them.
*
- * :TODO: includeHiddenFields has no meaning, this should be removed
- * :TODO: this method is rather long, maybe we can shorten it somehow.
- *
* @param artTitle Identifier of the article we want to fetch
* @param blogId If set, the article must belong to the given blog
* @return Returns an Article object or 'false' otherwise.
@@ -333,11 +330,13 @@
if( $postDate != $date )
return false;
}
- elseif( $maxDate != 0 && $date != -1 ) {
+ elseif( $maxDate > 0 && $date != -1 ) {
$postDate = substr($article->getDate(),0,strlen($maxDate));
- if( $postDate > $maxDate )
- return false;
+ if( $postDate > $maxDate ) {
+ return false;
+ }
}
+
return( true );
}
More information about the pLog-svn
mailing list