Skip to content

[BUGFIX] Backend PDF generation fails - Migrate DocumentController to cart-pdf v13 API (FileWriterService) #743

@johfeu

Description

@johfeu

Current Behavior
The Backend Order DocumentController's generatePdfDocument() method uses the deprecated PdfService::createPdf() API which no longer exists in cart-pdf v13 see extcode/cart_pdf#35
When attempting to generate PDF documents (invoice, delivery note, etc.) from the backend order module, the following error occurs:

Call to undefined method Extcode\CartPdf\Service\PdfService::createPdf()

Additionally, the class_exists() check uses PdfService::class which always returns true even though the createPdf() method was removed in cart-pdf v13.

Expected behavior/output

  • Backend PDF generation should work with cart-pdf v13
  • Clicking "Generate Invoice/Delivery Note" in the backend order module should successfully create and attach the PDF to the order item
  • The code should use the new cart-pdf v13 API: DocumentRenderService::renderDocument() + FileWriterService::writeContentToFile()

Use the same migration pattern is used in cart-pdf's own EventListener\Order\Finish\DocumentRenderer

Environment

  • TYPO3 version(s): 13.4
  • cart version: 11.7.1
  • cart-pdf version: dev-main (v13 compatible)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions