- Issue created by @facine
- Status changed to Needs review
about 1 year ago 5:57pm 24 August 2023 - last update
about 1 year ago 54 pass - π©πͺGermany Tomefa Dresden
On Drupal 10.1 and entity_print 2.13 i have the same error during configuration import.
This patch solve the issue and i can now import my configuration without problem.
- π¦πΉAustria nimoatwoodway Tyrol / Austria
Same here. Drupal 10.1 and entity_print 2.13. Patch #2 fixed it for me! Thenks!
- last update
12 months ago 54 pass - π«π·France flocondetoile Lyon
Hello,
Same error here with Drupal 10.1.6 and Entity Print 2.13, but with the print engine DomPDF. And during a cron job launched via drush to generate PDFs (which don't have a session).
/** @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper */ $stream_wrapper = \Drupal::service('stream_wrapper_manager'); $print_engine = \Drupal::service('plugin.manager.entity_print.print_engine')->createSelectedInstance('pdf'); $print_builder = \Drupal::service('entity_print.print_builder'); $billfile_uri = $print_builder->savePrintable($orders, $print_engine, 'private', $stream_wrapper->getTarget($file_destination . $bill_filename));
The stack trace
Trace : #0 /var/www/xxx/web/modules/contrib/entity_print/src/Plugin/EntityPrint/PrintEngine/DomPdf.php(285): Symfony\Component\HttpFoundation\Request->getSession() #1 /var/www/xxx/web/modules/contrib/entity_print/src/Plugin/EntityPrint/PrintEngine/DomPdf.php(238): Drupal\entity_print\Plugin\EntityPrint\PrintEngine\DomPdf->setupHttpContext() #2 /var/www/xxx/web/modules/contrib/entity_print/src/Plugin/EntityPrint/PrintEngine/DomPdf.php(228): Drupal\entity_print\Plugin\EntityPrint\PrintEngine\DomPdf->doRender() #3 /var/www/xxxx/web/modules/contrib/entity_print/src/PrintBuilder.php(100): Drupal\entity_print\Plugin\EntityPrint\PrintEngine\DomPdf->getBlob() #4 /var/www/xxx/web/modules/custom/xxx_commerce/src/SalesJournalGenerator.php(372): Drupal\entity_print\PrintBuilder->savePrintable() #5 /var/www/xxx/web/modules/custom/xxx_commerce/xxx_commerce.module(793): Drupal\xxx_commerce\SalesJournalGenerator->generateSalesJournal() #6 /var/www/xxx/web/core/lib/Drupal/Core/Cron.php(335): xxx_commerce_cron()
attached a patch with same fix for DomPdf print engine
- πΏπ¦South Africa PatrickMichael
#2 worked for me, thank you! Drupal 10.1.7, entity_print 8.x-2.13
- πͺπΈSpain aleix
#5 worked, It solves the related commerce ticketing send of mail issues
- Status changed to RTBC
10 months ago 8:55am 17 January 2024 - π©πͺGermany Tomefa Dresden
#2 solved the issue only for PhpWkhtmlToPdf
where #5 solved it for both PhpWkhtmlToPdf and DomPdf#5 should be used in preference of #2
With so many people using the patch, i will set the ticket to reviewed.
- π©πͺGermany Tomefa Dresden
Tomefa β changed the visibility of the branch 3383187-unexpected-error-with to hidden.
- π©πͺGermany Tomefa Dresden
Tomefa β changed the visibility of the branch 3383187-unexpected-error-with to active.
- Merge request !50Unexpected error with print engine PhpWkhtmlToPdf or DomPdf: Session has not been set β (Open) created by Tomefa
- last update
10 months ago 54 pass - Status changed to Needs review
10 months ago 10:40am 17 January 2024 - Status changed to RTBC
10 months ago 10:23am 18 January 2024 - πͺπΈSpain grota
we are using #5, applies cleanly to 2.12.0 and is IMHO a simple enough patch, moving to RTBC
- πͺπΈSpain SadySierralta
PDF was missing from commerce invoice confirmation mail attachments, after applying #5 the error, "Symfony\Component\HttpFoundation\Exception\SessionNotFoundException: Session has not been set.", is no longer appearing and PDF is attached in mail.
By the way this was happening while cron context.