bithost-gmbh / pdfviewhelpers

TYPO3 CMS extension that provides various Fluid ViewHelpers to generate PDF documents.
GNU General Public License v3.0
44 stars 20 forks source link

TYPO3 9 support #59

Closed luberti closed 6 years ago

luberti commented 6 years ago

Hello, we are developing on TYPO3 9 for a mid term project that will be released after it will become LTS. We need an extension to generate PDF files on the flay. I wanted to ask if you plan to support TYPO3 9 and if you have a timeline for that.

Thanks for your answer and your work.

maechler commented 6 years ago

Hi @luberti

We will definitely add support for TYPO3 9. At the earliest some time in September and at the latest a few weeks after TYPO3 9 LTS has been released. If you feel like already testing pdfviewhelpers on TYPO3 9 and reporting issues or even contributing some code, that would be appreciated!

Kind regards Markus

luberti commented 6 years ago

Thank you for your answer. If we shoudl find issues we will certanly report them and if we can fix them by ourselves we will submit a pull request. Cheers

maechler commented 6 years ago

@luberti Perfect, thanks!

luberti commented 6 years ago

Hi, we discovered an issues in your ext with regard to TYPO3 9. Since you are using TCPDF PHP library for rendering, which does not support namespaces, you are forced to use require_once to import it and you have placed it inside DocumentViewHelper.php. Unfortunately it got called to late for the buildClassSchema method inside TYPO3 9 build in ReflectionService class. As a consequence buildClassSchema throws an exception complaining it cannot find TCPDF. We have worked around it putting the require_once at the beginning of the DocumentViewHelper class. Is this acceptable from your point of view, so that we can make a pull request you can accept? Or you can make this change directly.

BTW I guess you are aware there is a new project maintained by the same author of TCPDF but is declared as "not ready" yet. So we guess we have to stick with the current TCPDF even though it contains some code deprecated in PHP 7.2

maechler commented 6 years ago

@luberti Thank you very much for this analysis!

As we will drop support for TYPO3 6 I think it should be possible to add the autoload.classmap configuration to our composer.json file. The same configuration we already used for autoload-dev (which then could be removed): https://github.com/bithost-gmbh/pdfviewhelpers/blob/d0faa7c96641c6f811bd981850dac22e9299419d/composer.json#L36

I think this should work for TYPO3 >= 7 LTS, even in non composer mode. If you feel like testing this and creating a pull request, that would be appreciated! If this remains the only compatibility error, I think we could add support for TYPO3 9 very soon! =)

Yes, this project has been around since more than 2 years, but unfortunately there seems to be little progress.. I also think we should stick to the current TCPDF, but I hope that either the older version starts to get updates again or the newer version would become production ready.

luberti commented 6 years ago

I will tall with my colleagues and let you know: unfortunately I'm going on holiday for a couple of weeks so this thing could be put on hold for a while , I will let you know as soon as I'm back.

maechler commented 6 years ago

@luberti No worries, I think I will soon find the time to test this.

luberti commented 6 years ago

Ok the first one that do the test will acknowledge the other.

Cheers

maechler commented 6 years ago

@luberti I tested adding the classmap configuration to composer.json, it seems to properly register the classes with the autoloader for TYPO3 >= 7 LTS. This also seems to fix all the compatibility problems with TYPO3 9! I think I will soon create a new release supporting TYPO3 9. Thanks for your analysis on that issue!

maechler commented 6 years ago

@luberti I created a new release v1.6.0 supporting TYPO3 9, it will soon be available in TER. Thanks again for your help on that!

maechler commented 6 years ago

@luberti We are currently working on v2.0 of pdfviewhelpers, you might consider to already use the current code from the develop branch. It is pretty stable, there are only a few features missing at this point. It will probably be released in September. The new version contains a lot of new features, cleanup, performance improvement and also some bugfixes. One of the key features is that it is now possible to define header and footer directly in the fluid template, see the example in the README file here: https://github.com/bithost-gmbh/pdfviewhelpers/blob/ef08bef962fad5c342aac4b1107e430ba48a9612/README.md

maechler commented 6 years ago

@luberti

Fortunately the developer of TCPDF still tries to make the library compatible with the newest PHP versions:

https://github.com/tecnickcom/TCPDF/blob/1861e33fe05f653b67d070f7c106463e7a5c26ed/CHANGELOG.TXT#L4-L5

We will update TCPDF before the next release of pdfviewhelpers.