I made my patch compatible with 2.2.0 version of "Serialization (PDF)" module.
I made my patch compatible with 2.2.0 version and fixed a few things. For example:
- We don't have to use neither
$mpdf->SetHTMLHeader($header_rendered, 'O');
(https://git.drupalcode.org/project/pdf_serialization/-/blob/2.2.0/src/Pd...) nor
$mpdf->SetHTMLFooter($footer_rendered);
(https://git.drupalcode.org/project/pdf_serialization/-/blob/2.2.0/src/Pd...) in getPDF() method of PdfManager class because the content override the header and footer this way.
- We have to take the export method into account because there can be batch export besides the standard one.
Additionally i aligned my patch of "Views Data Export" module to 2.2.0 version too. https://www.drupal.org/node/3204269 →
Patch is attached.
I added extra views variable to pdf_serialization_pdf_header
and pdf_serialization_pdf_footer
theme functions based on
https://www.drupal.org/project/pdf_serialization/issues/3331105#comment-...
🐛
Batch export support for Views data export module
Active
.
I added extra views variable to pdf_serialization_pdf_header
and pdf_serialization_pdf_footer
theme functions.
Hi @Lus
https://www.drupal.org/project/pdf_serialization/issues/3331105#comment-... 🐛 Batch export support for Views data export module Active
So how did you try to override the pdf-serialization-pdf.html.twig
file? I am asking because this works for me. I did with theme suggestions though.
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function ejp_export_theme_suggestions_pdf_serialization_pdf_alter(array &$suggestions, array $variables): void {
$suggestions[] = $variables['theme_hook_original'] . '__ejp_export';
}
Pls repoen the issue.
There is an issue with "applies" method of BatchNegotiator class. This doesn't take the "system.batch_page.json" route into account. So for example while the default theme is used on the "system.batch_page.html" route the admin theme is used on "system.batch_page.json" route. Question is why "system.batch_page.json" route is not taken into account in the "applies" method? In my opinion this should be consistent through the whole batch process regardless of this is the batch page("system.batch_page.html") or the batch ajax calls("system.batch_page.json").
Also the following is how the theme is set for the batch at the beginning.
function batch_process($redirect = NULL, Url $url = NULL, $redirect_callback = NULL) {
$batch =& batch_get();
$activeThemeName = \Drupal::service('theme.manager')->getActiveTheme();
$request = \Drupal::request();
if (isset($batch)) {
// Add process information
$process_info = [
'current_set' => 0,
'progressive' => TRUE,
'url' => $url ?? Url::fromRoute('system.batch_page.html'),
'source_url' => Url::fromRouteMatch(\Drupal::routeMatch())->mergeOptions(['query' => \Drupal::request()->query->all()]),
'batch_redirect' => $redirect,
'theme' => \Drupal::theme()->getActiveTheme()->getName(),
'redirect_callback' => $redirect_callback,
];
=>
" 'theme' => \Drupal::theme()->getActiveTheme()->getName(),"
So this should apply to the ajax calls too.
I created a patch for this issue.
https://www.drupal.org/project/drupal/issues/3088790#comment-14937914 🐛 Inconsistent database because of a bug in the Content Moderation module Needs work
This patch doesn't work in the following case:
- Content moderation with https://www.drupal.org/files/issues/2023-02-23/content-moderation-unpubl... → and moderation/translation enabled on a content type.
- Enable Croatian language.
- Create a Draft node in Croatian.
- Translate this node to English(Draft).
- Submit the Croatian translation into Published state.
- Submit the Croatian translation into Unpublished state.
- Check the node view page of Croatian translation where the "Latest version" tab should be visible(but it is not because the default revision is always the last revision).
However this scenario works with https://www.drupal.org/files/issues/2020-06-09/3088790-10.patch → and https://www.drupal.org/project/drupal/issues/3329066#comment-14962117 🐛 Creating a new translation may delete translations with drafts Fixed patches. Plus this works with https://www.drupal.org/project/drupal/issues/3088790#comment-14839675 🐛 Inconsistent database because of a bug in the Content Moderation module Needs work too.
@ericgsmith
Indeed, you are right. Thanks! I hid my patch.
Actually the "batch" path should always use the admin theme regardless of views path starts with "/admin" or not, because this is also the case in the core:
system.batch_page.json:
path: '/batch'
defaults:
_controller: '\Drupal\system\Controller\BatchController::batchPage'
requirements:
_access: 'TRUE'
_format: 'json'
options:
_admin_route: TRUE
So here the batch uses always the admin theme and this should be the case with the patch for this issue. I removed the
str_starts_with($this->getOption('path') ?? '', 'admin/')
part from the patch.