I posted this message a couple of weeks ago for the same problem ... without any
answer. I did not have time to read your patch ... I will do it soon.
-------- Original Message --------
Subject: [Tikiwiki-devel] CMS module
Date: Thu, 12 Feb 2004 20:14:54 -0500
From: broubrou <broubrou@...>
I am not new to Tiki, I was introduced to it by great Marc Laporte. Even if I
was a little bit suspicious at start, he finally got me to try it for a real
project. I did not contribute anything to the project yet, but since I am using
version 1.9 as a base for my project, I guess I will send at least a couple of
patches in the future.
The CMS (articles) module is what I consider to be the most important module
my current project. I successfully set it up using 1.7.x and it was working ok,
even if a couple features I needed were not there. I upgraded to 1.8 two days
ago, and the articles ceased to be displayed in the main page. I tried
1.9 and it's the same.
I browsed a couple of related files and I finally found why. Most of the
articles in the database are not ready to be published, so I set their publish
date in 2005 until we decide when to publish them. I only have 4 articles with
a publish date in the past that should be displayed in the main page.
The problem is with the $maxRecords parameter to the list_articles function as
function list_articles($offset = 0, $maxRecords = -1, $sort_mode =
'publishDate_desc', $find = '', $date = '', $user, $type = '', $topicId = '')
It is then used as a way to limit the result set in the SQL query as in :
$query = "select `tiki_articles`.*,
from `tiki_articles`, `tiki_article_types`, `users_users` $mid order by
$query_cant = "select count(*) from `tiki_articles`, `tiki_article_types`,
$result = $this->query($query,$bindvars,$maxRecords,$offset);
So if I my maxRecords is set to 10, as it is by default in the CMS module (I
don't remember if I changed that) AND if no article is to be published in the
first 10 ones the query finds ... no article will be displayed. It sorts
articles this way in the SQL query :
ORDER BY `publishDate` DESC
If you have a least 10 unpublished articles and that the max number of articles
to be displayed on the page is 10, you will not see anything.
I put my max to 100 so I can see my articles now ... it's ok because I have
4 of them now, but I will need a fix soon.
So finally my question is ... who is working on this module and is this problem
known? I did not see any mention of a similar bug on Sourceforge. Is there a
new version of this module planned soon? I can sure solve the problem myself, I
just don't want to interfere with anybody's work. I already have developer
access to the project.
Btw, can someone explain to me why list_article() is in tikilib.php ... it
to me like its place would be in artlib.php. I guess it is for
historical reasons, but seems really not pretty to me.