Hi,

great module, thanks for it!

If a source field's value is empty, the token expression is printed - which is ugly. It may be intended to ignore a value.

It would be great if an empty source field value would be treated as such by not writing anything of it into the target field.
It would be even better if this could be configured.

So if I would like to combine a string of two fields, the current behaviour e.g.:

"Contained things: [emtpy_field_token_printed], some tokenized value"

should become

"Contained things: , some tokenized value"

Then it is completely up to the user to design his strings.

Comments

maxilein created an issue. See original summary.

maxilein’s picture

Issue summary: View changes
haydent’s picture

I couldn't agree more. I will update the code and push to the development version as I want to update the field formatter anyway. Should also be added to the Drupal 7 version.

  • 0e65eda committed on 8.x-1.x
    Issue #2888727 by maxilein: Add Parameter if source value is emtpy
    
haydent’s picture

Status: Active » Needs review

Hi maxilein

Could you please try the latest dev version for Drupal 8?

I have included an additional checkbox on the field settings form to decide if you want to remove the empty tokens from the final string.

maxilein’s picture

Hi hyadent,

thank you. I will try it tomorrow and let you know as soon as I have results.
Sounds great!

  • 17b7adc committed on 7.x-1.x
    Issue #2888727 by maxilein: Add Parameter if source value is emtpy
    
haydent’s picture

Status: Needs review » Fixed

Setting this to fixed as has been added into the latest release.

Status: Fixed » Closed (fixed)

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