Skip to content
Snippets Groups Projects
Commit c8c35903 authored by git's avatar git Committed by Liam Morland
Browse files

Issue #3147525 by Project Update Bot: Automated Drupal 9 compatibility fixes

parent 843f95fc
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@
namespace Drupal\fillpdf\Plugin\PdfBackend;
use function GuzzleHttp\json_encode;
use function GuzzleHttp\json_decode;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\file\FileInterface;
use Drupal\file\Entity\File;
......@@ -85,7 +87,7 @@ class LocalServerPdfBackend extends PdfBackendBase implements ContainerFactoryPl
'pdf' => base64_encode($pdf_content),
];
$json = \GuzzleHttp\json_encode($request);
$json = json_encode($request);
$fields = [];
......@@ -107,7 +109,7 @@ class LocalServerPdfBackend extends PdfBackendBase implements ContainerFactoryPl
}
}
$fields = \GuzzleHttp\json_decode((string) $fields_response->getBody(), TRUE);
$fields = json_decode((string) $fields_response->getBody(), TRUE);
return $fields;
}
......@@ -158,7 +160,7 @@ class LocalServerPdfBackend extends PdfBackendBase implements ContainerFactoryPl
'fields' => $api_fields,
];
$json = \GuzzleHttp\json_encode($request);
$json = json_encode($request);
try {
$response = $this->httpClient->post($this->configuration['local_service_endpoint'] . '/api/v1/merge', [
......@@ -166,7 +168,7 @@ class LocalServerPdfBackend extends PdfBackendBase implements ContainerFactoryPl
'headers' => ['Content-Type' => 'application/json'],
]);
$decoded = \GuzzleHttp\json_decode((string) $response->getBody(), TRUE);
$decoded = json_decode((string) $response->getBody(), TRUE);
return base64_decode($decoded['pdf']);
}
catch (RequestException $e) {
......
......@@ -40,7 +40,7 @@ function create_xfdf($file, array $info, $enc = 'UTF-8') {
if ($file) {
$ids_ele->setAttribute('original', md5($file));
}
$ids_ele->setAttribute('modified', REQUEST_TIME);
$ids_ele->setAttribute('modified', \Drupal::time()->getRequestTime());
if ($file) {
$f_ele = $xfdf_ele->appendChild($doc->createElement('f'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment