This Help forum is for issues relates to webtrees 1.7. For issues related to webtrees 2.0, please use that forum.
Before asking for help please read "Requesting Help and Suggestions" by clicking on that tab above here."
  • Page:
  • 1

TOPIC:

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 6 days ago #1

  • morten
  • morten's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 52
PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17)

I know that development and updates now has been discontinued on the 1.7-branch, so I'm not asking for that, but I wonder if anyone has experienced the same and know if there's an easy way to fix this?

It worked just fine (for me) in Webtrees 1.7.16 and earlier (and it still does), so I guess something has been changed in the code since then

All HTML reports works fine, but all PDF reports (small and big) just returns "Internal Server Error". Sadly I don't have access to any server error logs, but I know that nothing has been changed on the server

Thanks for any advice!

Please Log in or Create an account to join the conversation.

Last edit: by morten.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 6 days ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
> I don't have access to any server error logs

Are you able to enable the display of fatal errors in PHP? See webtrees.net/faq/500/

> PDF reports is not working

All reports broken - or just some reports?

> but I know that nothing has been changed on the server

Often people say this, but it turns out that their webhost has upgraded or re-installed PHP, and failed to install all the PHP libraries.
The PDF reports require a specific PHP library.

Based on the limited info, this would seem the most likely explanation.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 6 days ago #3

  • morten
  • morten's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 52
> Are you able to enable the display of fatal errors in PHP?

No, I'm not. Both my local server and online server are Windows and a .htaccess file doesn't seem to have no effect. On my local server I've tried to open C:\inetpub\logs but for some reason I'm not allowed neither via the filemanager nor the iis manager

> All reports broken - or just some reports?

All PDF reports (small and big)

> Often people say this, but it turns out that their webhost has upgraded or re-installed PHP, and failed to install all the PHP libraries.
The PDF reports require a specific PHP library.

I understand that you suggest this, but in my case I'm 100% sure that there has been no changes to the server(s). I have both a local server on my laptop, which I control completely myself, and an online server where I control both PHP versions and enabled libraries, and neither me nor anybody else has done any changes to these servers in years

Like a said, this is working perfectly (for me) using Webtrees 1.7.16 and earlier versions. I've done manual upgrades through all versions, just keeping the data folder, and it was first at 1.7.17 that the PDF reports function started to fail. I've kept old versions as backups and I have just testet all versions below (on both servers) and can confirm that the PDF reports function works perfectly on all these:

1.7.8, 1.7.9, 1.7.11, 1.7.12, 1.7.13, 1.7.14 and 1.7.16 (I've skipped 1.7.10 and 1.7.15, but expect them to work as well)

And I can confirm again that nothing has been done to my servers neither through these stages, nor after 1.7.16. PHP version has always been (and still is) 5.4.16 on the online server and 5.6.24 on the local server, and MySQL version has always been (and still is) 5.5.37 on the online server and 5.5.42 on the local server. There has been no changes to the PHP library (or anything else) either.

My Quick-Fix to this problem is using 1.7.16 whenever I need to make a PDF report, but I would rather do it from 1.7.18, avoiding the switching hassel

There are several reasons why I don't have upgraded to the 2.x versions (yet) by the way, but one of them are that I mainly use webtrees from a computer and find the old GUI more suitable on that platform. With the 2.x versions, everything is too big (for me). I see less and I have to scroll a lot more. I understand your focus adjusting the GUI (and technology) to suit mobile platforms better though. You're doing a great job and you've always done

Please Log in or Create an account to join the conversation.

Last edit: by morten.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 5 days ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
1.7.17 did have a small bug fix for the reports.

It would be good to know what error you are getting. But maybe just stick with 1.7.16?

The only update for 1.7.18 is the addition of a message on the control panel saying that support for 1.7 will end later this year.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 5 days ago #5

  • morten
  • morten's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 52
> 1.7.17 did have a small bug fix for the reports

Well, I guess this bug "fix" actually was what introduced the problem then, at least for me :-( Do you know exactly what part(s) of the code that was changed (from what to what) and in which file(s) ? If not too complex changes, maybe I could paste in the 1.7.16 code at the same place(s)

> It would be good to know what error you are getting

I know, but as I said, I've not been able to access the logs (in C:\inetpub\logs) and making a .htaccess file with the suggested code didn't have any effect either (on windows). Maybe there's some more I can try to do inside IIS or with php.ini (?), but I've had no luck with this so far. My local server just returns nothing (blank page) and my online server returns a generic "Internal Server Error" page. Anyway, what would (maybe) help me is if you could point out what part(s) of the reports code that was bug "fixed" (from what to what) in which file(s) in version 1.7.17, if the changes are not too complex ofcourse. I'm not expecting you to use a lot of time on this. I could also revert back to version 1.7.16 (or use this the times I need to make a pdf report)

Please Log in or Create an account to join the conversation.

Last edit: by morten.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 5 days ago #6

  • morten
  • morten's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 52
I managed to copy the whole c:\inetpub\logs folder to another place and open the log files from there, but there is not much useful information in there it seems:

2021-04-10 06:01:38 127.0.0.1 GET /webtrees/reportengine.php ged=morten&action=setup&report=modules_v3/pedigree_report/report.xml&pid=I54138944 80 - 127.0.0.1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64;+rv:87.0)+Gecko/20100101+Firefox/87.0 http://localhost/webtrees/index.php?ctype=user&ged=morten 200 0 0 2315

...But by turning on error_reporting, display_errors and html_errors in php.ini I get this response (instead of a blank page) when I try to create a PDF report:

Parse error: syntax error, unexpected '[' in C:\Web\Webtrees\vendor\tecnickcom\tcpdf\tcpdf.php on line 12387

I repeat again that I'm only getting this error when using version 1.7.17 and 1.7.18, and that nothing has been done to the server configuration. In version 1.7.16 and earlier versions, creating PDF reports works just fine

Please Log in or Create an account to join the conversation.

Last edit: by morten.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 5 days ago #7

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
> Parse error: syntax error, unexpected '[' in C:\Web\Webtrees\vendor\tecnickcom\tcpdf\tcpdf.php on line 12387

Aha! This is exactly what I was looking for.

This is a bug in the TCPDF library. TCPDF is supposed to work with PHP 5.3 onwards, but it has used some syntax that requires PHP 7.0

It was reported here: github.com/tecnickcom/TCPDF/issues/176
It was fixed here: github.com/tecnickcom/TCPDF/pull/183

I guess very few people still use PHP 5.4. Perhap only you! ;-)
I'm sure you know, it reached end-of-life in 2015...

I have merged the fix into the 1.7 code.

You should be able to download it from github.com/fisharebest/webtrees/archive/refs/heads/1.7.zip
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 5 days ago #8

  • morten
  • morten's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 52
> This is a bug in the TCPDF library. TCPDF is supposed to work with PHP 5.3 onwards, but it has used some syntax that requires PHP 7.0

Ok

> I guess very few people still use PHP 5.4. Perhap only you! ;-)

Hehe, might be true ;-)

> I have merged the fix into the 1.7 code

Thanks for that! I have just a couple of questions regarding this though:

Does 1.7.zip contain the (fixed) 1.7.17 version or the 1.7.18 version of webtrees?

As I have customized/changed a few things (in different files), I'd rather just replace the file(s) or lines that you've altered than starting with new files, if possible

- Is tcpdf.php the only file that has been changed?
- Is line 12387 the only line that has been replaced?
- Is it replaced by these two lines (the exact code) that's showing here ?
- Can I just replace either tcpdf.php or make the same changes in my existing tcpdf.php to fix this?
- Will the fix also work on PHP 7.0-7.3 (even though it doesn't need it)?
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by morten.
Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 4 days ago #9

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
> Does 1.7.zip contain the (fixed) 1.7.17 version or the 1.7.18 version of webtrees?

This is an update to the latest code. So, an update of 1.7.18 (which might become 1.7.19 if I create a new release for this).

> - Is tcpdf.php the only file that has been changed?

No

> - Is line 12387 the only line that has been replaced?

No

> - Is it replaced by these two lines (the exact code) that's showing here ?

Yes - but there have also been many other changes.

> - Can I just replace either tcpdf.php or make the same changes in my existing tcpdf.php to fix this?

Why not just replace this entire file? Do you have any local modifications to it?

> - Will the fix also work on PHP 7.0-7.3 (even though it doesn't need it)?

Yes - the updated version of TCPDF should work on all versions of PHP from 5.3 to 8.0
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 4 days ago #10

  • morten
  • morten's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 52
> This is an update to the latest code. So, an update of 1.7.18 (which might become 1.7.19 if I create a new release for this).

Ok. Thanks for clarifying this

As for the rest of your answers I guess this means that if I should choose to continue to use the 1.7.18 (or 1.7.17) version that I already have, I could just replace tcpdf.php (which I don't have modifyed) with the tcppdf.php included in 1.7.zip to get the pdf reports working? Have I understood this right?

Thanks for your time

Please Log in or Create an account to join the conversation.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 4 days ago #11

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
Probably.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 4 days ago #12

  • morten
  • morten's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 52
Yep, it worked fine just replacing tcpdf.php

Before I let go of this I'm just curious why the 1.7.zip is about 5MB smaller than the regular webtrees-1.7.18.zip (and prior releases). Is something missing or is it complete?

Please Log in or Create an account to join the conversation.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 4 days ago #13

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515

Yep, it worked fine just replacing tcpdf.php

Before I let go of this I'm just curious why the 1.7.zip is about 5MB smaller than the regular webtrees-1.7.18.zip (and prior releases). Is something missing or is it complete?


You have downloaded the development code, not a full distribution.

The development code does not contain the compiled language files.
So, the development code only works if you either install on top of an existing installation, or manually compile the language files.
Also, it contains uncompressed versions of the CSS and JS files.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

PDF reports is not working (for me) in Webtrees 1.7.18 (and 1.7.17) 1 month 4 days ago #14

  • morten
  • morten's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 52
> You have downloaded the development code, not a full distribution

Ok, thanks for explaining. I guess I'll just stick with the regular 1.7.18 version then and just replace tcpdf.php (at least until a 1.7.19 version might be released)

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum