Document hooks in fillpdf.api.php

Created on 12 February 2012, over 12 years ago
Updated 16 February 2023, over 1 year ago

Create a fillpdf.api.php and document hooks there.

Original report

I have a token from webform [webform:webform-val-number_of_guests] that I want to multiple by ticket price to insert that into a field in the PDF.

Can you provide any help on this?

Thanks.

πŸ“Œ Task
Status

Active

Version

1.0

Component

Documentation

Created by

πŸ‡¬πŸ‡§United Kingdom bjalford

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡΅πŸ‡°Pakistan Allahnoor Turab

    For me it is not working with drupal version 9.5.2 and fillpdf version 5.0
    I not see any output.
    I want this hook to remove prefix and change date format for some fields
    /**
    * Implements hook_fillpdf_merge_fields_alter().
    */
    function miscellaneous_fillpdf_merge_fields_alter(&$fields, $context) {
    dump($fields);
    // $submission = end($webforms); // Gets the last sid passed.
    // $ticket_price = 5.00; // @todo: Replace with code to get this from the webform object.
    // $fields['The rent is'] *= $ticket_price; // Multiply number of guests by ticket price.
    }

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    I thought dump() was a Twig function. It won't work in a hook implementation. If devel module is enabled, you should be able to use dpm().

  • πŸ‡΅πŸ‡°Pakistan Allahnoor Turab

    No success, actually the hook is not triggering.

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    hook_fillpdf_merge_fields_alter() only exists in Drupal 7.

Production build 0.69.0 2024