Log in | Register | Lost password

Bottom
getpublist error with function printlist AND a filter AND shorturls
  • Posted: 22.08.2008, 22:24
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Hello everyone !

    I get a very strange behavior that i cannot understand :
    I am using the printlist function to display a list of pagesetter publications to be printed... I am also using a specific template and some filter parameters.
    Since i am using shorturl, here is how the link to that page looks like :
    http:/mysite.com/Pagesetter/view/func/printlist/tid/7/tpl/list-print/filter/organisme:eq:8
    The equivalent in "normal" url is :
    http:/mysite.com/index.php?module=pagesetter&func=printlist&tid=7&tpl=list-print&filter=organisme:eq:8

    Now, BOTH links give me the correct page displaying properly the correct list of filtered publications BUT when i use the shorturl (which i normally do), i then get when i load a different page from my site the following "pn-errormsg" :

    /home/www/modules/pagesetter/pnuserapi.php(372): "getPubList" failed:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
    ') AND NOT pg_indepot
    ORDER BY pg_field57_table.pg_lineno, pg_field64_table.pg_li' at line 23 while executing:

    Code

    SELECT

    zk_pagesetter_pubdata7.pg_id,

    zk_pagesetter_pubdata7.pg_pid,

    pg_author,

    UNIX_TIMESTAMP(pg_created) as pg_created,

    pg_approvalState,

    pn_topicname,

    pg_revision,

    pg_online,

    pg_field56

    FROM zk_pagesetter_pubdata7

    LEFT JOIN zk_topics ON pg_topic = pn_topicid

    LEFT JOIN zk_pagesetter_pubheader ON pg_tid = 7 AND

    zk_pagesetter_pubheader.pg_pid = zk_pagesetter_pubdata7.pg_pid

    LEFT JOIN zk_pagesetter_listitems as pg_field57_table ON pg_field57_table.pg_id = pg_field57

    LEFT JOIN zk_pagesetter_listitems as pg_field64_table ON pg_field64_table.pg_id = pg_field64



    WHERE (pg_publishDate <= NOW() || pg_publishDate IS NULL)

    AND (NOW() < pg_expireDate || pg_expireDate IS NULL)

    AND pg_online

    AND pg_showInList

    AND (pg_language = 'fra' OR pg_language = 'x_all')

    AND ()

    AND NOT pg_indepot

    ORDER BY pg_field57_table.pg_lineno, pg_field64_table.pg_lineno, pg_field58, pg_revision

    [setVar] ? la ligne 302 dans le fichier /home/www/includes/pnobjlib/SessionUtil.class.php

    I tried to track down that error... and i simply couldn't !!!
    You can notice that the SQL error on line 23 "AND ()" comes from a condition that is empty. That is where normally my filter should be... And where it is actually because the full SQL statement is passed properly when i load the page (since i get the right publication list).

    I put some breakpoints within the pagesetter/pnuserapi.php (where the "error" is supposed to be raised) and even within the includes/pnobjlib/SessionUtil.class.php (where the error message is logged) but wasn't able to catch anything !
    I am not a zikula expert and there is something i am totally missing here !! Why and how is that error raised ?!
    Thanks for your help and your enlightenment !!!
    Cheers

    Guitch

Template courtesy of Designs By Darren.