i'm using s9y 1.5beta1 and i notice an issue with showing the preview of new or old posts.
While clicking on preview i have this error:
Code: Select all
Error in SELECT count(distinct e.id)
ERROR: missing FROM-clause entry for table "e" LINE 1: SELECT count(distinct e.id) ^
$serendipity['fullCountQuery'] looks like empty here.
I'm using postgresql and php 5.2.6
---------------------------------------------------------------------------------------------
Now the preview is working again, i did two main changes:
Made available this to serendipity_getTotalEntries()
Code: Select all
// Store the unique query condition for entries for later reference, like getting the total article count.
$serendipity['fullCountQuery'] = "
FROM
{$serendipity['dbPrefix']}entries AS e";
if ($joinauthors) {
$serendipity['fullCountQuery'] .= "
LEFT JOIN {$serendipity['dbPrefix']}authors a
ON e.authorid = a.authorid";
}
if ($joincategories || !isset($serendipity['enableACL']) || $serendipity['enableACL'] == true) {
// Category joins are REQUIRED when the ACLs are enabled.
$serendipity['fullCountQuery'] .= "
LEFT JOIN {$serendipity['dbPrefix']}entrycat ec
ON e.id = ec.entryid
LEFT JOIN {$serendipity['dbPrefix']}category c
ON ec.categoryid = c.categoryid";
}
if ($joinown) {
$cond['joins'] .= $joinown;
}
$serendipity['fullCountQuery'] .="
{$cond['joins']}
{$cond['and']}";
Code: Select all
parent.document.getElementById('serendipity_iframe').style.height = document.getElementById('mainpane').offsetHeight
+ parseInt(document.getElementById('mainpane').style.marginTop)
+ parseInt(document.getElementById('mainpane').style.marginBottom)
+ 'px';
This is a fast hack though, but i've noticed the issue is still present in svn code.