-
Notifications
You must be signed in to change notification settings - Fork 6
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
NEW Import PDF export functionality from BasePage in cwp/cwp #1
NEW Import PDF export functionality from BasePage in cwp/cwp #1
Conversation
8d8cd31
to
d0fbb6a
Compare
Noted issue: clicking the "Export to PDF" link for a page initially fails with this message:
Subsequent requests succeed and open the PDF. I suspect this could be a macOS issue with piping the wkhtmltopdf output to stdout. If we're happy, I think we should get this merge and raise that as a separate issue. We could write it to the PHP temp dir instead of piping to stdout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good, other than what appear to be some non-critical superfluous (and magic) function calls. Would you like to address them, or merge as is?
} | ||
|
||
if (!$binaryPath) { | ||
user_error('Neither WKHTMLTOPDF_BINARY nor BasePage.wkhtmltopdf_binary are defined', E_USER_ERROR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error message needs to no reference BasePage
anymore I think, it'll send people off on a wild goose chase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good call, will update
return false; | ||
} | ||
|
||
$path = $this->owner->getPdfFilename(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
owner is going the long way around for this call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this follows the standard practice for extensions edited there's almost no reason to do this so may as well update it. Will push.
…taObject with extension
I've raised an issue for the error I noted above here: #2 |
Issue: silverstripe/cwp#31
Requires silverstripe/cwp#32