Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYPO3 9 support #59

Closed
luberti opened this issue Aug 6, 2018 · 12 comments
Closed

TYPO3 9 support #59

luberti opened this issue Aug 6, 2018 · 12 comments
Assignees

Comments

@luberti
Copy link

luberti commented Aug 6, 2018

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
Copy link
Member

maechler commented Aug 6, 2018

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

@maechler maechler self-assigned this Aug 6, 2018
@luberti
Copy link
Author

luberti commented Aug 6, 2018

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
Copy link
Member

maechler commented Aug 6, 2018

@luberti Perfect, thanks!

@luberti
Copy link
Author

luberti commented Aug 9, 2018

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
Copy link
Member

@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):

"classmap": ["Resources/Private/PHP/tcpdf/", "Resources/Private/PHP/fpdi/"]

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
Copy link
Author

luberti commented Aug 10, 2018

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
Copy link
Member

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

@luberti
Copy link
Author

luberti commented Aug 10, 2018

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

Cheers

@maechler
Copy link
Member

@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
Copy link
Member

@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
Copy link
Member

@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
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants