Empty token values are showing up as [node:field_name]...

Comments

wizonesolutions’s picture

It's best to set the original one back to active and change the version number.

Can you paste your Fill PDF link? You can change the domain to example.com if necessary.

Can you also take a screenshot of the section where the "TOKEN VALUES" section confirms that you can use the token you are trying to use? Maybe there's a typo.

Finally, has this always been happening? (Or have you just started using the module?)

ErnestoJaboneta’s picture

StatusFileSize
new79.33 KB
new82.26 KB

I've just started using the module.
(Sorry about the duplicate post. For some reason I didn't think to change the status filter to All on the issues list and so I couldn't find the original.)

https://example.com/fillpdf?fid=24&nid=53

I've attached two screenshots. One with values filled in and one with the values removed from the node. For the last name field nothing shows up when the field is empty, but the others show the "[node:field_name]".

wizonesolutions’s picture

Hmm, that's strange. I'll do some testing on this and get back to you. Are first and last name both Text fields?

It looks like the first empty field works properly but subsequent ones fail. I bet this has something to do with the changes to the token system in Drupal 7.

wizonesolutions’s picture

OK, I've reproduced this issue and am troubleshooting.

wizonesolutions’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.66 KB

Discovered the issue. According to #1272028: Field token not replaced when field is empty, calling modules need to pass 'clear' => TRUE to token_replace if blanks should be returned when tokens cannot be replaced.

Ernesto, can you try this patch (see http://drupal.org/patch for how to apply it) and let me know if it works?

Bumping version.

ErnestoJaboneta’s picture

Yes, that seems to have worked.

wizonesolutions’s picture

Status: Needs review » Fixed

Thanks. Committed. And 7.x-1.1 is coming right up.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit ec672e6 on 7.x-1.x, 7.x-2.x, 7.x-2.x-tests1, 7.x-1.x-ubercartbackporttest by wizonesolutions:
    Issue #1313972: Erase token values if no replacements available.