Skip to content

Gravity Flow: {workflow_timeline} formatting  #1594

@jakejackson1

Description

@jakejackson1

Description
The {workflow_timeline} merge tag relies on the nl2br() feature to display correctly on a HTML page. Since Gravity PDF does not run any merge tags through nl2br(), this causes display issues in the PDF.

The following is a temporary workaround:

/**
 * Reprocess the Gravity Flow workflow timeline so new lines are converted to <br> tags
 */
add_filter( 'gfpdf_pdf_field_content_html', function ( $value, $field, $entry, $form, $pdf_field ) {
	if ( strpos( $field->content, '{workflow_timeline}' ) !== false ) {
		return wp_kses_post( \GFCommon::replace_variables( $field->content, $form, $entry ) );
	}

	return $value;
}, 10, 5 );

It's not an elegant solution though, and we should research a more sustainable alternative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions