diff --git a/fillpdf.install b/fillpdf.install index f32b4b30e1b7a01eadce40084c4aba2e6c589490..1a4fa785c63d71eed574eca8f2a31e0ac6d4c99e 100644 --- a/fillpdf.install +++ b/fillpdf.install @@ -7,10 +7,12 @@ use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\StreamWrapper\StreamWrapperInterface; +use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\fillpdf\Entity\FillPdfForm; use Drupal\fillpdf\Service\FillPdfAdminFormHelper; use Drupal\Core\Link; +use Drupal\Core\Url; /** * Add scheme field to FillPdfForm. @@ -152,8 +154,8 @@ function fillpdf_update_8107() { } $config->save(); - return new TranslatableMarkup('All currently available file storage schemes were added to FillPDF configuration. Please review at %link.', [ - '%link' => Link::createFromRoute(new TranslatableMarkup('FillPDF settings'), 'fillpdf.forms_admin'), + return new FormattableMarkup('All currently available file storage schemes were added to FillPDF configuration. Please review at <a href=":url">FillPDF settings</a>.', [ + ':url' => Url::fromRoute('fillpdf.settings')->setOption('base_url', \Drupal::request()->getBasePath())->toString(), ]); } @@ -169,15 +171,16 @@ function fillpdf_update_8108() { // a 'destination_path', we need to unset 'scheme' to ensure nothing changes. $updated_ids = []; foreach ($fillpdf_forms as $id => $form) { - if (empty($form->get('destination_path'))) { + if (empty($form->getStoragePath())) { $status = $form->set('scheme', NULL)->save(); if ($status === SAVED_UPDATED) { - $updated_ids[] = $id; + $base_path = ['base_url' => \Drupal::request()->getBasePath()]; + $updated_ids[] = Link::createFromRoute($id, 'entity.fillpdf_form.edit_form', ['fillpdf_form' => $id], $base_path)->toString(); } } } - return new TranslatableMarkup('The following FillPDF forms were updated: %list.', [ - '%list' => implode(', ', $updated_ids), + return new FormattableMarkup('The following FillPDF forms were updated to the changed storage logic: %list.', [ + '%list' => new FormattableMarkup(implode(', ', $updated_ids), []), ]); }