Webform 4.x is out, and it has Token-driven token support. It uses the submission
machine-readable name for its tokens, so I should figure out how to support this. I should probably replace both submission
and webform
tokens when in Webform-filling mode, and I can't really see any issue with this...yet. Alternatively, I could detect the major version of Webform and act accordingly, but that rarely ends well. So better probably to detect the submission
token type.
Webform Tokens will still work with Webform 4.x tokens at the moment, but API-breaking changes are likely on the way, and as such, best to log this now and look into it soon.
Comment | File | Size | Author |
---|---|---|---|
#18 | fillpdf_1612270_webform_4.patch | 1.91 KB | wizonesolutions |
#16 | webform_tokens_1934340_renamespace.patch | 1.9 KB | wizonesolutions |
#15 | webform_tokens_1717934_support_webform_4.patch | 4.45 KB | wizonesolutions |
#10 | 1612270.patch | 738 bytes | c_archer |
#3 | Webform Rules activated.png | 196.82 KB | Denfish |
Comments
Comment #1
garidan CreditAttribution: garidan commentedA have just installed webforms 4.x alpha 4 because I need webform rules, and it's its requirement.
In fillpdf I see no more webforms for token replacement.
Did anyone see that too ?
It could be a problem on my side, but probably it's not.
Thanks
Comment #2
poeticninja CreditAttribution: poeticninja commentedThe webform tokens do not show up unless you start looking for them. I have a blank token drop down arrow and when I click it the webform tokens shows up. So it gets renames from webform to blank. I just thought I would share what I found incase anyone else has this problem.
Comment #3
Denfish CreditAttribution: Denfish commentedWebform 7.x-4.0-alpha6
Webform Rules 7.x-1.4
Webform Tokens 7.x-1.1+3-dev
This can be reproduced. If Webform Rules is deactivated the problem goes away.
Screen shot for greater clarity:
Comment #4
ekidman CreditAttribution: ekidman commentedNot sure if this is the best thread to post this, but here it is:
I'm having issues with FillPDF since upgrading to webform 4 last week. I saw there are several posts about this, but I can't seem to find a solution. Is there any working combination of webform 7.x-4.0-alpha6 and FillPDF? None of the tokens seem to work, as they all come out blank in the final PDF. I read that there was an API change in webform that may have caused this.
I tried the 7.x-2.x-dev version of FillPDF, along with the PDF Forms API, but get the same results.
From what I've read, it appears the webform_tokens module may not be needed with the new versions of webform, as webform now includes tokens. However, turning off the webform_tokens module takes away all the "webform" tokens in the FillPDF settings. Upgrading to the dev version of webform tokens gives me an error when I try to open the PDF's.
Just can't seem to find any working combination of webform 7.x-4.0-alpha6 and FillPDF/webform_tokens - is anyone successfully using both?
My setup:
Drupal 7.18
FillPDF 7.x-1.9 (also tried 2.x-dev and 1.x-dev)
Webform Tokens 7.x-1.1
Webform 7.x-4.0-alpha6
Comment #5
wizonesolutionsSorry for the trouble you're having.
No, Webform Tokens and Fill PDF don't support Webform 4.x yet. It's Fill PDF that will need to (Webform Tokens is only about providing Token tokens because Webform 3 didn't have them).
Patches/sponsorship welcome if possible. In any case, upgrading this task to critical...although it'll still be a bit before I get to it.
If a 7.x-1.x patch is provided, I'm willing to commit it if it works. It shouldn't be too difficult to swap in Webform 4-compatible code. I just don't want to remove support for Webform 3 + Webform Tokens until 7.x-2.x.
Comment #6
enbl CreditAttribution: enbl commentedEdit: sorry, cross-post with answer above. To add as an FYI to others with this same problem: downgrading from Webform 4.x to 3.x is not currently possible unless you have a database backup from before running update.php. I started with Webform 4.x as one of the first modules I added, so I don't have any meaningful backups prior to adding it ): Time to start an entirely new site, I guess.
---
I'm having a similar problem. I can't get webform *data* to populate a form using the Webform Tokens module. If I disable Webform Rules, I can get webform tokens that *aren't* data to populate the form - e.g., webform:meta-sid and webform:meta-label-(component) work. But I cannot come up with any way to get any user-submitted values to populate.
I am using:
Drupal 7.15
Fill PDF 7.x-1.9 (also tried 2.x dev, does not produce a pdf at all under these circumstances)
Webform Tokens 7.x-1.1+3-dev
Webform 7.x-4.0-alpha6
See also this as-yet-unanswered stackexchange post.
Comment #7
ekidman CreditAttribution: ekidman commentedComment #8
enbl CreditAttribution: enbl commentedekidman: A co-worker helped me develop code that can be added to fillpdf.module to make it work with Webform 4.x, which I believe will also cause it to stop working with Webform 3.x. It reformats webform 4.x input retrieved using webform_get_submission() to act like 3.x input; see here for a description of the relevant change between 3.x and 4.x.
wizonesolutions: please forgive my newbieness and not knowing how to make a patch (on major rush to complete project before tomorrow). I wanted to post this so ekidman could use it as a temporary solution if necessary.
In tokens.module, find the line
$token_objects['webform'] = $webform['submission'];
And place the following directly after it and before the line that begins with "$token":
Edit: make sure you have Webform Tokens enabled, have Webform Rules disabled, and are using the tokens Webform Tokens supplies (e.g., [webform:val-textmetest] for the value of element textmetest).
Comment #9
ekidman CreditAttribution: ekidman commentedenbl,
Great, I'll test it out at some point tomorrow. Thanks! If everything works as expected maybe we can make it into a patch.
Comment #10
c_archer CreditAttribution: c_archer as a volunteer and at Upbeat Productions commentedHi,
I have tested the code and it worked for me. I have created a patch for this.
Cheers
Comment #11
ekidman CreditAttribution: ekidman commentedJust applied the patch, and it seems to fix the tokens issue. Thanks to both of you for your work on this!
Comment #12
wizonesolutionsHi guys - this probably should've been split out into its own support request. I'm glad a patch came of it, in any case, but it can't go into 7.x-1.x in its current state without a deeper explanation. What does it mean to "treat 4.x submissions like 3.x submissions," for example? Are there edge cases or common cases where this would confuse a user?
Why does Webform Rules fail with it (I know it has 4.x support)?
The final patch will need to work with Webform Rules and should not expect Webform Tokens (I'm removing that dependency in Fill PDF 2).
The 7.x-1.x patch should expect Webform Tokens and act appropriately based on Webform version (it's fine to ignore it, that is, but it shouldn't break). It would be nice if it could work with Webform Rules because the default rule assumes Webform Rules.
Please don't take this as devaluing the work that went into the current patch. It's just not module-ready yet. But it's great that people with this issue have an intermediate fix available. Thanks!
Comment #13
wizonesolutionsComment #14
wizonesolutionsComment #15
wizonesolutionsCommitted in 45b346d0e8466f9f0fcd67cfcb0fbc7705d57fbe.
Comment #16
wizonesolutionsWrong patch above.
Comment #17
wizonesolutionsAh, whoops. This isn't committed yet. Crossed wires today. One sec.
Comment #18
wizonesolutionsThere, committed. Keep in mind this will be in 7.x-2.x-dev. The patch *should* work on 7.x-1.x, but until it gets some testing it I won't commit it.
Comment #19
wizonesolutionsCommit was 6451ab8cca54f03c1701ce7fef74a64f3624494c
Comment #20
spazfoxAwesome. The patch at #18 (applied against FillPDF 7.x-2.x-dev) is working like a charm for me with Webform 7.x-4.0-alpha6 (and no Webform Tokens module installed)!
Comment #21
castlemaster CreditAttribution: castlemaster commentedHi,
There seems to be problems with fillpdf 7.x-2.x-dev, applied path in #18 and PDF Forms API.
I tried to parse a pdf document from webform submissions without success and started debugging until I found the problem.
In
function pdf_forms_fill($filepath, $field_data, array $fill_options = array())
$fillpdf_info is not passed through, if I included it all goes as expected.
I also had to put
if (empty($path_to_pdftk)) {
$path_to_pdftk = 'pdftk';
}
somewhere in fillpdf.
Is it a work in progress or am I doing something wrong? I mean, is fillpdf 7.x-2.x-dev supposed to work with Webform 4.x?
Regards
Comment #22
wizonesolutionscastlemaster: 7.x-2.x-dev only works with Fill PDF Service at the moment. I think I may have forgotten to push the commit that put the patch into the module. Checking. Thanks for the prompt.
The `pdftk` issue is something that was fixed in Fill PDF 7.x-1.x but that I haven't fixed over in PDF Forms API yet. PDF Forms API is still under development, though it does work.
...yep, I had forgotten to push the commit. How embarrassing :) — it's in Git now and will be in the dev release once it regenerates (the date will change).
Comment #23
castlemaster CreditAttribution: castlemaster commentedThanks for the effort
Comment #24
tostinni CreditAttribution: tostinni commentedIt seems that patch #10 works well with Fill PDF 7.x-1.9 and webform 7.x-4.x while patch #18 doesn't.
Thanks a lot for these patches.
Comment #25
wizonesolutionstostinni: Correct. Patch #18 is for 7.x-2.x. It still needs to be ported to 7.x-1.x if anyone wants to.
Comment #26
wizonesolutionsThis has been backported to 7.x-1.x now. Open new issues for any problems.
Note: If you upgrade to Webform Tokens 7.x-1.3, you can now use Webform Rules without a conflict. However, you will need to use
webform-tokens:
tokens instead of webform: tokens.If you don't use Webform Rules, then you shouldn't have to think about this. Open an issue and report a bug if you don't use Webform Rules and your tokens are affected when you update the module (but note that
webform:
tokens, while they work in 7.x-2.x, are not shown and will not be shown. If you're on the bleeding edge, update your Webform Tokens too :)Comment #27
tostinni CreditAttribution: tostinni commentedThank you.
Comment #30
Ivan Ottinger CreditAttribution: Ivan Ottinger commentedHello guys,
I am just wondering. Should I apply the patch to the latest version of Fill PDF module? Because I am using Webforms 4.0 and can't see any tokens on mapping page. Thank you very much.
Comment #31
wizonesolutionsYeah, if you are on the official release (1.9) you need to. I would try 7.x-1.x-dev, though; it should be pretty stable.
Comment #32
Ivan Ottinger CreditAttribution: Ivan Ottinger commentedThank you wizonesolutions,
I tried 7.x-1.x-dev and it works nicely with Webform 7.x-4.2. :)
Comment #33
sharkins17 CreditAttribution: sharkins17 commentedRunning Webform 7.x-4.9 and FillPDF 7.x-1.9+13-dev. Quite new to figuring this kind of thing out. What tokens am I supposed to be using? I've tried:
Where {component} becomes the field key.
Comment #34
Liam Morland[submission:values:?]
Remember to include parent field_keys if using fieldsets.
Comment #35
sharkins17 CreditAttribution: sharkins17 commentedIt doesn't appear to have any parent fields: https://onedrive.live.com/redir?resid=72A755A3F55D55BA!19305&authkey=!AP...
Error log shows nothing besides a notice that a PDF was generated. If I don't use a token, it puts that text in the PDF fine. But any submission/webform tokens don't seem to output anything.
For reference, I'm using the URL method under Use a URL to merge the form data into the PDF until I can get it working: https://www.drupal.org/node/1431638
Comment #36
SchwebDesign CreditAttribution: SchwebDesign commentedI was able to get this working; I'll explain here for clarity, since "Remember to include parent field_keys if using fieldsets." above helped me get this working.
Example Webform Components:
- Customer name (Textfield)
- Physical Address (Fieldset)
-- Street (Textfield)
-- Address Line 2 (Fieldset or layoutbox)
--- City (Textfield)
--- State (Select options)
--- Zip (Textfield)
Example tokens for each that work for me:
Customer Name:
Physical Address Line 1:
Physical Address Line 2:
Note specific module versions installed currently which are working:
Webform: 7.x-4.9
Fillpdf: 7.x-1.9+13-dev
PDF forms API 7.x-1.x-dev
Webform Rules 7.x-1.6
Webform tokens not installed
I hope this helps someone!
Comment #37
Pedro Leree CreditAttribution: Pedro Leree commentedThanks SchwebDesign!
It helped me a lot! Just spent about an hour looking for this. Your post (#36) just made my day!
Gracias!