- πΈπͺSweden killua99
Now that I've been working more with the module, I will maintain only Drupal 9.4+. Sadly I couldn't introduce this for Drupal 7
I think it would be good if, when saving the pdf to the server via Rules, the file also be added to Drupal with file_save_data.
I was able to achieve this by adding a couple of lines to the views_pdf_rules_save function in views_pdf.rules.inc
So the final foreach loop goes from
foreach ($view->display as $id => $display) {
if ($display->display_plugin == 'pdf' && isset($display->handler) && $id == $display_id) {
$display->handler->execute($path, 'F');
}
}
To
foreach ($view->display as $id => $display) {
if ($display->display_plugin == 'pdf' && isset($display->handler) && $id == $display_id) {
$display->handler->execute($path, 'F');
$pdf = file_get_contents($path);
$file = file_save_data($pdf, $path, FILE_EXISTS_REPLACE);
}
}
Ideally, the file would then be exposed to Rules but this at least allows it to be fetched in Rules by property name, or whatever.
Let me know if you think this is useful, I'd be happy to roll a patch.
Thanks,
Matt
Needs work
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Now that I've been working more with the module, I will maintain only Drupal 9.4+. Sadly I couldn't introduce this for Drupal 7