Menu ▾ ▴

#128 Report Options needs Fix

open
nobody
5
2005-08-02
2005-08-02
No

Group : 4.0.4

When trying to use Report Options, the generated
reports display empty information. Looking at the logs
shows that there is an error in the templates.

Attached is a diff file for fixing this problem.

Discussion

  • Joël Larose

    Joël Larose - 2005-08-02

    Diff for fixing problems with report options.

     
  • Hans Fr. Nordhaug

    Logged In: YES
    user_id=21914

    I have looked at your fix which basically is replacing
    {php}if ($col == ...) { ... }{/php}
    with
    {php}if ($col == ...) : ... endif;{/php}
    This should be equivalent. What version of Smarty are you using?
    I'm using version 2.6.9 and have no problems with
    constructs like
    {php}if ($col == ...) { ... }{/php}

    Hans

    PS! I'm not a IT developer - just interested.

     
  • Joël Larose

    Joël Larose - 2005-08-03

    Logged In: YES
    user_id=720001

    hansfn, you are right, that is exactly what I did. I am
    just using the version of Smarty that came in the package
    (apparently 2.6.2). Someone else posted the same problem on
    the forum, I replied with the fix I used.

    https://sourceforge.net/forum/forum.php?thread_id=1295385&forum_id=249083

    Before the fix, when I tried to use the "per category"
    report option, the report didn't show up, and the phperror
    log file showed :
    [29-Jul-2005 14:40:12] PHP Parse error: parse error,
    unexpected ':' in
    /var/www/html/issue-tracker/cache/templates/compiled/%%-16^%%-1605316202^per_category.tp
    l.php on line 15

    I'm not a PHP expert by any stretch of the imagination. My
    theory is that Smarty tried to interpret the stuff in {...}
    for itself, and through garbage when it realized they
    weren't smarty tags. It's quite possible that the newer
    version of Smarty resolves this.

    Or maybe it's my version of PHP :
    % php --version
    PHP 5.0.4 (cli) (built: Jul 4 2005 10:39:59)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend
    Technologies

     
  • Hans Fr. Nordhaug

    Logged In: YES
    user_id=21914

    If you look closer at
    /var/www/html/issue-tracker/cache/templates/
    compiled/%%-16^%%-1605316202^per_category.tpl.php
    you'll notice that the problem is with these two lines of
    per_category.tpl

    {php}if ($col == 1) { print "<td class=\"label\"
    colspan=\"2\">&nbsp;</td>\n</tr>\n"; }{/php}
    {else}

    That "{else}" doesn't get associated with the correct
    smarty-if further up in the file. So it's not "{php}if (...)
    { ... }{/php}" in general, but that construct followed by an
    {else} that is the problem. (There are several "{php}if
    (...) { ... }{/php}" constructs in per_category.tpl that
    doesn't cause this problem.)

    This is indeed a bug, but I think it's in Smarty - could you
    please try to upgrade?

    Hans

    PS! I'm really a EnterTrack user, but since they are almost
    the same I try to help...

     
  • Joël Larose

    Joël Larose - 2005-08-04

    Logged In: YES
    user_id=720001

    I have a working solution running. I'm happy with it for now.

    Whether I upgrade or not doesn't help anyone else who
    downloads and installs the rpm/tarball since the version of
    smarty that I am using is the one included in the 4.0.4
    release. What will help is that whoever maintains this
    project implements one or both solutions that you and have
    have proposed here which will fix the bug.

     

Log in to post a comment.