When a PDF has a default node ID set, the list of tokens on the edit field mapping page should only show Webform value tokens from that node. This would make it easier to find the right token to include.
When a PDF has a default node ID set, the list of tokens on the edit field mapping page should only show Webform value tokens from that node. This would make it easier to find the right token to include.
Comments
Comment #1
wizonesolutionsYeah, I'd love to restrict the token list as much as possible where it makes sense. I think we allow overriding the default node ID though, in which case those other tokens could be relevant. Maybe we need a "Show all tokens" checkbox that makes an AJAX request to reload the token table?
Comment #2
liam morlandI thought this would be easy. However, there isn't much in fillpdf about tokens. _fillpdf_admin_token_form() just passes things off to the Drupal token system. It would take a change to webform_tokens_token_info() to generate a different list of token. I don't know how to find out, within that function, what the default nid is for the current PDF.
Could we call the hook_token_info() implementations directly, filter the results, then put that through theme_token_tree()?
Comment #3
wizonesolutionsYeah, there would definitely be some filtering. I think I've added
fillpdf_load()now, which would return an object that should have a default_nid property or something. That's the default nid. It's in the Fill PDF metadata.Comment #4
liam morlandFillPDF no longer lists all the tokens, just the generic token that needs the Webform field key, so this request is obsolete.