Closed (fixed)
Project:
FillPDF
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2011 at 22:36 UTC
Updated:
17 Apr 2014 at 04:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
landing commentedOkay - I figured out how to rename files by using token values in the Title field found at admin/content/fillpdf/fid ... here's the code I added to the fillpdf.module file:
Then on line 308 I changed
to
Comment #2
wizonesolutionsThanks for your contribution. Can you roll this as a patch? It'll be much easier to deal with - and more likely to get in if you want this feature in the module in the future. I have no objections to it - I think I was just waiting for someone to ask.
Patch information is at http://drupal.org/patch.
Comment #3
landing commentedCan I send you my modified module file so you can create the patch?
Comment #4
wizonesolutionsNew features are developed in 7.x first and then backported currently. I'll look into this the next time I'm adding new features. Patches of course welcome. @landing - you don't need to use Git to make a patch. You can also just copy the file, then make your changes, then use
diff -uP oldfile newfile > fillpdf_1264872_title_tokens.patch(for example).Comment #5
wizonesolutionsOops.
Comment #6
wizonesolutionsComment #7
wizonesolutionsComment #8
wizonesolutionsFinally - here's a patch to add this functionality to Drupal 7. It uses the existing Title field of the PDF (at the top of the form, in case it's become invisible to you like it has me).
Comment #9
wizonesolutionsOops - that had a nasty bug in it that prevented sanitization of the filename (returned too early). Use this instead.
Comment #10
wizonesolutionsComment #11
wizonesolutionsDiscovered a bug where forms without any replacements set up wouldn't replace the tokens in the title. I don't know why anyone would do this, but now if they want to, they can!
Full patch.
Comment #12
wizonesolutionsOh yeah, and the latest one was rolled against the latest -dev, a.k.a. 7.x-1.5 (needless to say).
Comment #13
wizonesolutionsOK, this is the patch I committed in the end - realized I needed to indicate that the Title field supports tokens! So added a description and a TOKENS fieldset under it.
Comment #14
wizonesolutionslanding wrote some code for this, so I can probably base the D6 backport off that (plus what D7 now has).
Comment #15
alexborsody commentedHere is the patch to be ported to D6
http://drupal.org/files/fillpdf_1264872_title_tokens_5.patch
Comment #16
wizonesolutionsIf this is working, I approve. Commit 'er!
Comment #17
wizonesolutionsI saw that this got committed a while ago.
Comment #18
wizonesolutionsDe-tag also.