PdfFormat route \Drupal::routeMatch()

Created on 21 November 2022, about 2 years ago
Updated 22 February 2024, 10 months ago

Problem/Motivation

PdfFormat::getOutput() gets the entity from the route. But, $this->entity already exists. The routeMatch is unnecessary.

Steps to reproduce

$printable = \Drupal::service('printable.controller');
$node = \Drupal::service('entity_type.manager')->getStorage('node')->load(1);

$file = $printable->getOutput($node, 'pdf', []);

// $file will be the full path to the file

Proposed resolution

      $entity_type = $this->entity->getEntityTypeId();
      $pdf_location = $token_service->replace($pdf_location, [$entity_type => $this->entity]);

API changes

Data model changes

πŸ“Œ Task
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bluegeek9

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024