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

Plugin link leads to 404 #117

Closed
derJake opened this issue Feb 24, 2021 · 2 comments
Closed

Plugin link leads to 404 #117

derJake opened this issue Feb 24, 2021 · 2 comments

Comments

@derJake
Copy link

derJake commented Feb 24, 2021

I ran into an issue when trying to use the extension plugin to generate a PDF of TYPO3 page containing a tx_news detail plugin. I've included the web2pdf plugin below the tx_news plugin expecting to be able to download a PDF version of the page when I click the "Print Current Page" link provided by web2pdf, yet I encounter a 404 "ERR_INVALID_RESPONSE" page.

I've tried to track the error through xdebug and the pdf file is generated and seems to be read by the middleware which returns a response object with response code 200 all the way to the TYPO3 bootstrapper.

Expected behaviour:
Clicking the plugin link returns a file stream with content-disposition header telling the browser to download the stream as a file.

Observed behaviour:
A 404 error is returned with error const "ERR_INVALID_RESPONSE" being shown in the browser window.

Steps to reproduce:

  1. set up a TYPO3 10.4 installation via composer (e.g. TYPO3 composer helper)
  2. configure DB etc. in DDEV
  3. run composer require mittwald/web2pdf
  4. include Typoscript in Template
  5. put web2pdf plugin on page
  6. Click "Print Current Page" on said page

Environment:
DDEV 1.16.2
PHP 7.4
MySQL 5.7
Apache 2.4.38
TYPO3 10.4.13

@derghostface
Copy link

I had the same problem when inserting the link on a record detail view. I solved it by adding addQueryStringMethod="GET" into the f:link.action in the GeneratePdfLink.html

@derJake
Copy link
Author

derJake commented Mar 3, 2021

@derghostface thanks for the suggestion!

Right now I had solved my problem by using the news view helper.
<n:link newsItem="{newsItem}" settings="{settings}" class="c-button" configuration="{additionalParams: '&tx_web2pdf_pi1[argument]=printPage'}">

@derJake derJake closed this as completed Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants