Menu

phpbt-1.0.6/jpgraph-1.2.2 error fastlinks2 ??

Help
2007-12-03
2013-04-16
  • Danilo Gurovich

    Danilo Gurovich - 2007-12-03

    on front page, error states "JpGraph Error General PHP error : Undefined variable: fastlinks2"

    I have everything else set up correctly(?), the jpgimages folder is writeable.  Running Linux and php 4.3.9  Looks like I'm close here, but...

     
    • Bryce Nesbitt

      Bryce Nesbitt - 2007-12-03

      If you find a solution, please post it.  Version numbers of all components may help also.

       
    • Patrick

      Patrick - 2008-01-27

      Sorry but where can I find the version 1.0.6? On the website is only version 1.0.3 for download.

      ???

       
    • R. Douglas Barbieri

      I'm experiencing the same error (but I'm using version 1.04 :-)). I get:

      General PHP error:
      Undefined variable: fastlinks2

      on the front page. I found the variable in this code here in index.php:

      104 // Build fastlinks.  We need all of the project names.
      105 if (true) {
      106     $rs = $db->query("select project_id, project_name from " . TBL_PROJECT);
      107     while (list($iProject_id, $sProject_name) = $rs->fetchRow(DB_FETCHMODE_ORDERED)) {
      108         $fastlinks1 .= "<a href=\&quot;bug.php?op=add&amp;project=$iProject_id\&quot;>$sProject_name</a>&nbsp;&nbsp;|&nbsp;&nb    sp;";
      109         $fastlinks2 .= "<a href=\&quot;query.php?op=doquery&amp;projects=$iProject_id&amp;open=1&amp;order=priority_name&    amp;sort=desc\&quot;>$sProject_name</a>&nbsp;&nbsp;|&nbsp;&nbsp;";
      110     }
      111     $t->assign('fastlinks1',$fastlinks1);
      112     $t->assign('fastlinks2',$fastlinks2);
      113 }

      Is the error happening in line 112 above? What exactly is "$t" (I assume it's an object but I don't see where it is defined). Do you have to have "fastlinks2" defined in this object somewhere?

       
    • R. Douglas Barbieri

      Ah, now I see. I'm running PHP5 and it looks like you have to predefine variables. After line 105 above, I put in the following:

      $fastlinks1 = "";
      $fastlinks2 = "":

      and it stopped reporting that error. Now I get:

      General PHP error:
      Non-static method DB::isError() should not be called statically

      I saw this in include.php:

      57 /*
      58 ** Note confusing php5 E_STRICT error, which affects JPGraph use:
      59 ** "Non-static method DB::isError() should not be called statically "
      60 ** It's unclear what solution works for both php4 and php5.
      61 ** the documentation recommends PEAR::isError($db) which is also non-static
      62 */

      I tried turning off E_STRICT in my php.ini but to no avail. Same error and no JPGraph. :(

       
    • R. Douglas Barbieri

      And yet I discover more as I dig...

      My problem was two fold.

      1) It helps to read the fine docs that the PHPBT guys wrote. Specifically, in the INSTALL file in the distribution tarball. :-) On line 40 it says:
        
         If you get error "Non-static method DB::isError() should not be called statically",
         then edit the JpGraph configuration to set "CATCH_PHPERRMSG" to false.

      2) Not a problem, but for the life of me I could not find the JpGraph configuration file! I'm running Ubuntu Feisty, and I discovered that the libphp-jpgraph package is *seriously* out of date (1.5.2, considering the latest JPGraph release is 1.22!). Once I uninstalled the debian package and installed JPGraph version 1.22, I discovered a nifty file called jpg-config.inc in the distribution, and in it the variable "CATCH_PHPERRMSG" is set to true. Setting this to false caused JPGraph to work! SUCCESS!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.