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
How to skip requiring mpdf 2 #572
Comments
Follow the instruction as mentioned in the message you would see as part of the exception. If you do not need export or PDF functionality of the grid view extension, then:
use kartik\grid\GridView;
echo GridView::widget([
'dataProvider' => $dp,
'columns' => $cols,
'export' => false
]); OR
use kartik\grid\GridView;
echo GridView::widget([
'dataProvider' => $dp,
'columns' => $cols,
'exportConfig' => [
GridView::HTML => [],
GridView::CSV => [],
// do not include PDF
]
]); |
Thanks! |
The secondary solution
does not work for me, I still get the Exception. What works is:
|
Yes that is correct. |
It's good that there's a way to disable PDF export, but what I am still saying, also in regard of the other issue, is that everyone who is using Just my 2 cents. |
Could you mention what is the expectation here and what is to be improved? The exception will be received by anyone who does not have yii2-mpdf installed in his/her app but is still trying to use PDF export functionality of yii2-grid. |
Which is the default, if you do not "unconfigure" the PDF export. |
@kartik-v I believe @schmunk42 is suggesting that pdf export be turned off by default with a note to people who are interested in enabling it that they will need to do so. That way all other users by default don't run into this issue. It would be a breaking change though ... |
Will need to evaluate this based on feedback from the majority of the community. Currently the way it is designed, most extended functionalities of the extension are enabled by default until it is disabled by each developer in their own grid configuration. The only difference being PDF dependency to mPDF library was earlier included in composer.json earlier to ensure extension works with PDF enabled by default. But because of the feedback in the other issue, that mPDF may not be needed by default - the mPDF package dependency was eliminated from the composer.json with the option of user installing it on his own if needed OR disable PDF. To ensure that developers do not face an issue, there is an exception validation message included for the above change. This validates if PDF functionality is being accessed without mPDF library and I suppose its more a documentation pre-requisite now for devs when using the extension, to disable it if not needed using the options above. Will await for more feedback and then take a call on extending or updating this. |
How about this solution @kartik-v
|
@SamMousa good suggestions... will think on these. |
@kartik-v I can create a PR if you want this improvement; it will not break backwards compatiblity in any working setup. (It will break BC for people that currently get exceptions for missing dependencies). |
Sure you can submit a PR. |
Fixed issue #572: Silently disable PDF when dependency is not available.
Some time ago you this problem solved, but currently it back!
The text was updated successfully, but these errors were encountered: