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

render_to_string fix #962

Merged
merged 1 commit into from
May 4, 2022
Merged

Conversation

cbmike
Copy link
Contributor

@cbmike cbmike commented Feb 3, 2021

pass options only to the render_to_string_with_wicked_pdf

@unixmonkey
Copy link
Collaborator

Why is this desirable for you? This means if you call render with a block or arguments, they will now be ignored. Is this from a change in Rails internals or something?

@@ -22,7 +22,7 @@ def render(*args)
def render_to_string(*args)
options = args.first
if options.is_a?(Hash) && options.key?(:pdf)
render_to_string_with_wicked_pdf(options, *args, &block)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block indeed does not exist here... but should we keep *args ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method below does not take a 2nd arg... so this looks correct

Copy link
Contributor

@mathieujobin mathieujobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

problem introduced in #925

It appears this is missing some tests.
this should be part of next release

@KonstantinReido
Copy link

PDF generation in my project stopped work because of this issue. It happened after an update on 2.6.0 from 2.1.0.

undefined local variable or method 'block'

Will be good to see these changes in the next release.

@mathieujobin
Copy link
Contributor

manual merge into master here
gem "wicked_pdf", github: 'mathieujobin/wicked_pdf', branch: 'pr-962'

all tests passed - https://github.com/mathieujobin/wicked_pdf/actions/runs/2268571025

@unixmonkey unixmonkey merged commit 5a6ee89 into mileszs:master May 4, 2022
@unixmonkey
Copy link
Collaborator

This has been released in version 2.6.2. Please let me know if you have any issues.
Thank you!

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

Successfully merging this pull request may close these issues.

None yet

4 participants