From fb1b69bea997f55e783c1d703290adbf8d2aa12e Mon Sep 17 00:00:00 2001
From: Christian Johansson <freakalis@204187.no-reply.drupal.org>
Date: Wed, 28 Dec 2011 19:33:21 -0800
Subject: [PATCH] Issue #1336458: Provide alter hook before generation.

---
 fillpdf.module | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fillpdf.module b/fillpdf.module
index da358a5..f1c4b24 100644
--- a/fillpdf.module
+++ b/fillpdf.module
@@ -337,6 +337,14 @@ function fillpdf_merge_pdf($fid, $nids = null, $webform_arr = null, $sample = nu
     }
   }
 
+  // Provide hook_fillpdf_merge_fields_alter() to let other modules
+  // alter fields before pdf generation.
+  $context = array(
+    'nodes' => $nodes,
+    'webforms' => $webforms,
+  );
+  drupal_alter('fillpdf_merge_fields_alter', $fields, $context);
+
   $output_name = preg_replace('/[^a-zA-Z0-9_]/', '', $fillpdf_info->title) .'.pdf';
   $pdf_data = _fillpdf_get_file_contents($fillpdf_info->url, "<front>");
   $fillpdf_remote_service = variable_get('fillpdf_remote_service', TRUE);
-- 
GitLab