Board index Bugs s9y 1.5beta1 - Preview stopped to work [solved]

Found a bug? Tell us!!
iwkse
 
Posts: 2
Joined: Tue Nov 03, 2009 12:47 am

Postby iwkse » Tue Nov 03, 2009 12:53 am

Hi all,
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) ^


I see it's referring to function serendipity_getTotalEntries in include/functions_entries_inc.php
$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']}";


and comment out this:
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';



which breaks the preview giving the wrong height.

This is a fast hack though, but i've noticed the issue is still present in svn code.

User avatar
garvinhicking
Core Developer
 
Posts: 29962
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Tue Nov 03, 2009 11:25 am

Hi!

Hm, the fullcountquery should actually always be set; a missing "FROM" clause should never really occur. While your hack might work on your specific installation, this would break a couple of things.

Did you do any other manual modifications to your blog? Did you use any custom templating that utilizes smarty {fetchPrintEntries} or similar functions?

The other code you uncommented would mean that you are using a preview_iframe.tpl that is not built for your own template; this file always need adaptation if you do not use the normal s9y class names for containers...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

iwkse
 
Posts: 2
Joined: Tue Nov 03, 2009 12:47 am

Postby iwkse » Tue Nov 03, 2009 5:02 pm

Hi Garvin!

Thanks for your reply, i'm using the theme/template Bex01 which doesn't seem to use {fetchPrintEntries} or something similar i think.
Probably i did some other small modifications, what i actually did is to switch form s9y 1.4 to 1.5beta1 and i think i had to do few small changes to let it works or to let away the warnings. Anyway if this is only my personal issue it's ok since i found a workaround to it.

Keep the occasion to thank you & the other s9y developers for the great blog, i like it a lot :-)

Best regards
Salvatore

User avatar
garvinhicking
Core Developer
 
Posts: 29962
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Tue Nov 03, 2009 6:32 pm

Hi!

You're welcome! If it surfaces again, just come back here and we'll try to investigate it some more :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

cvelo
 
Posts: 2
Joined: Thu Apr 22, 2010 1:38 pm

Postby cvelo » Thu Apr 22, 2010 1:40 pm

I have recently upgraded from 1.4.1 to 1.5.2 and am using the BEX01 theme and old and new blog entry previews have also stopped working for me. I haven't done any customizations of the BEX01 theme or the Serendipity installation.
I am not seeing any errors when I click on preview - just a thin green line (like the top of my BEX01 theme).
Unfortunately the code in serendipity_getTotelEntries has changed so the workaround posted will not work for me. :-(
(fyi: using PHP version 4.3.9)

User avatar
garvinhicking
Core Developer
 
Posts: 29962
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Thu Apr 22, 2010 8:41 pm

Hi!

Does the bex01 template have a "preview_iframe.tpl" file? This one is usually the culprit when the CSS and the HTML structure of the preview code do not match up. Usually this is caused when template authors port over foreign templates, without adapting the preview_iframe.tpl file to match the global HTML structure, so that usual CSS can be applied properly...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

cvelo
 
Posts: 2
Joined: Thu Apr 22, 2010 1:38 pm

Postby cvelo » Sun Apr 25, 2010 8:29 am

Thanks for the response.
Actually, the BEX01 does not appear to have a "preview_iframe.tpl" file. The temporary workaround I ended up using was to edit the $SERENDIPITY_HOME/serendipity_config.inc.php file and set the value:
Code: Select all
$serendipity['use_iframe'] = false;

I don't get the full preview with header and footer, but I can preview enough of my blog entry to be somewhat workable.



Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest