Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1039: Added base_url variable to maestro notification twig #95

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa
- Adding Lat and Long fetching to DataAddress
- [#84](https://github.com/OS2Forms/os2forms/pull/84)
Added digital post test command.
- [#95](https://github.com/OS2Forms/os2forms/pull/95)
Added `base_url` variable to twig templates.

## [3.14.1] 2024-01-16

Expand Down
10 changes: 10 additions & 0 deletions modules/os2forms_attachment/os2forms_attachment.module
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Site\Settings;
use Drupal\os2forms_attachment\Entity\AttachmentComponent;

/**
Expand Down Expand Up @@ -317,3 +318,12 @@ function os2forms_attachment_module_implements_alter(&$implementations, $hook) {
}

}

/**
* Implements hook_preprocess().
*
* Add 'base_url' variable to be used by templates.
*/
function os2forms_attachment_preprocess(&$vars) {
$vars['base_url'] = Settings::get('base_url');
jekuaitk marked this conversation as resolved.
Show resolved Hide resolved
}
2 changes: 2 additions & 0 deletions modules/os2forms_forloeb/src/MaestroHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\Mail\MailManagerInterface;
use Drupal\Core\Render\Markup;
use Drupal\Core\Site\Settings;
use Drupal\Core\Url;
use Drupal\entity_print\Plugin\EntityPrintPluginManagerInterface;
use Drupal\maestro\Engine\MaestroEngine;
Expand Down Expand Up @@ -615,6 +616,7 @@ private function renderHtml(
'action_label' => $actionLabel,
'webform_submission' => $submission,
'handler' => $this,
'base_url' => Settings::get('base_url'),
],
];

Expand Down
Loading