Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gravity Flow: {workflow_timeline} formatting #1594

Open
jakejackson1 opened this issue Nov 28, 2024 · 0 comments
Open

Gravity Flow: {workflow_timeline} formatting #1594

jakejackson1 opened this issue Nov 28, 2024 · 0 comments
Labels

Comments

@jakejackson1
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant