Please describe the issue you're having
If you accept the answer, please mark the topic as [SOLVED] by clicking the tick.

Moderators: RussH, cptr13

Forum rules: Just please remember to play nicely once you walk through the door. You can disagree with us, or any other commenters in this forum, but respect our space and keep your comments directed to the topic at hand.
By atomicbob
#172
Seems like I'm getting an old error that was supposedly fixed in version 0.7 (I'm using 0.8.0 and have gotten the same error in 0.9.1). The error I'm getting is the same one found in this bug report: http://www.catsone.com/bugs/?do=details&task_id=63

Basically I am trying to generate a report from a Job Order. This fails because fpdf can't open the image "file" which is a URL to generate a JPG image. I believe the problem is related to permissions. We have an LDAP that people have to authenticate against to view CATS. Since ReportsUI.php calls fpdf.php with the URL I believe the credentials are not passed in correctly. This causes the following error:

FPDF error: Missing or incorrect image file: http:// . . . cats/index.php?m=graphs&a=jobOrderReportGraph&data=0%2C0%2C0%2C0

If I cut and paste this URL into a browser it works just fine, probably because the browser is authenticated.
Code: Select all
        /* Note that the server is not logged in when getting this file from
         * itself.
         */
        // FIXME: Pass session cookie in URL? Use cURL and send a cookie? I
        //        really don't like this... There has to be a way.
        // FIXME: "could not make seekable" - http://demo.catsone.net/index.php?m=graphs&a=jobOrderReportGraph&data=%2C%2C%2C
        //        in /usr/local/www/catsone.net/data/lib/fpdf/fpdf.php on line 1500
        $URI = CATSUtility::getAbsoluteURI(
            CATSUtility::getIndexName()
            . '?m=graphs&a=jobOrderReportGraph&data='
            . urlencode(implode(',', $dataSet))
        );

        $pdf->Image($URI, 70, 95, 80, 80, 'jpg');
The old bug report says this was fixed. Does anybody know how it was fixed, whether it should still be fixed and if there is an easy work-around? The FIXME tags refer to passing a cookie, yet this doesn't seem to be the case anymore? Any ideas why and/or what happened? It sure would be nice to have a source code repository we could search through to get easy answers (not that I expect that from this particular project).
User avatar
By RussH
#193
Sorry Bob... no joy from me.. but I expect this works fine on a vanilla CATS installation?
User avatar
By RussH
#481
Bob, did you ever fix this?
By atomicbob
#488
No, I coded around the problem. Basically the problem comes because the code creates a PDF that contains an embedded image. To get the embedded image it makes a web request to a PHP page that creates a chart (just like the ones in other parts of CATS). The problem is that since the user's web browser isn't making the request the authorization credentials are not passed to the PHP page. This causes an error that causes the fpdf process to quit. I basically diagnosed the problem correctly in my original post. I haven't kept up with any updates to see if it has been fixed. Instead . . .

Since the chart is kind of dumb (it is just a bar chart of the information contained within the report), my work-around was to embed a link to the chart instead of throwing the error back.
By scott1981
#2049
Russ,

I reposted a new github issue but this time I included my server environment in it. Here it goes in case it makes a difference:

System Information

General Information
Operating System: Linux ice.weblocalhost.com 2.6.32-504.12.2.el6.x86_64 #1 SMP Wed Mar 11 22:03:14 UTC 2015 x86_64
Operating System Type: CATS thinks your operating system is UNIX.
PHP Version: 5.5.22
Database Version: MySQL 5.5.42-cll
Installation Directory: /home/vro/public_html/internal/ats.test


It would be really nice to get this working, as it looks fantastic in the demo site :)
By scott1981
#2056
RussH wrote:HI Scott - as per your bug report, I can't reproduce this on the cats test site - the report generation works just fine;

http://opencats.org/test/cats/
Found a fix (and an opportunity for feature/functionality request). I use htaccess as part of security measures to control who can access cats :)

I figured that removing htaccess fixes the issue. Is there any way that this could work along with htaccess protection?

Thanks.

It's essential to keep these synchronized to ensur[…]

Export part in Job Order order search

Same problem as mine. Maybe you're right, I'll che[…]

The error message you're encountering indicates th[…]

Errors restoring mysqldump backup

doesnot work for me