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

Broken Excel export #1604

Closed
smnedelko opened this issue Nov 1, 2024 · 2 comments · Fixed by #1636
Closed

Broken Excel export #1604

smnedelko opened this issue Nov 1, 2024 · 2 comments · Fixed by #1636
Assignees
Labels
issue Something isn't working correctly

Comments

@smnedelko
Copy link

What happened?

When exporting submissions to Excel format, the next error occurs:

yii\base\ErrorException: ob_end_clean(): Failed to delete buffer. No buffer to delete in /app/vendor/solspace/craft-freeform/packages/plugin/src/Library/Export/ExportExcel.php:42

In the plugin/src/Library/Export/ExportExcel.php, the buffer is read using ob_get_clean function:

$writer->save('php://output');

$content = ob_get_clean();

ob_end_clean();

To fix it, the ob_get_clean should be replaced with the ob_get_contents function.

Errors and Stack Trace (if available)

yii\base\ErrorException: ob_end_clean(): Failed to delete buffer. No buffer to delete in /app/vendor/solspace/craft-freeform/packages/plugin/src/Library/Export/ExportExcel.php:42
Stack trace:
#0 /app/vendor/craftcms/cms/src/web/ErrorHandler.php(79): yii\base\ErrorHandler->handleError(8, 'ob_end_clean():...', '/app/vendor/sol...', 42)
#1 [internal function]: craft\web\ErrorHandler->handleError(8, 'ob_end_clean():...', '/app/vendor/sol...', 42)
#2 /app/vendor/solspace/craft-freeform/packages/plugin/src/Library/Export/ExportExcel.php(42): ob_end_clean()
#3 /app/vendor/solspace/craft-freeform/packages/plugin/src/Services/Pro/ExportProfilesService.php(271): Solspace\Freeform\Library\Export\ExportExcel->export()
#4 /app/vendor/solspace/craft-freeform/packages/plugin/src/controllers/export/QuickExportController.php(275): Solspace\Freeform\Services\Pro\ExportProfilesService->export(Object(Solspace\Freeform\Library\Export\ExportExcel), Object(Solspace\Freeform\Form\Types\Regular))
#5 [internal function]: Solspace\Freeform\controllers\export\QuickExportController->actionIndex()
#6 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#7 /app/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#8 /app/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('', Array)
#9 /app/vendor/craftcms/cms/src/web/Application.php(350): yii\base\Module->runAction('freeform/export...', Array)
#10 /app/vendor/craftcms/cms/src/web/Application.php(649): craft\web\Application->runAction('freeform/export...', Array)
#11 /app/vendor/craftcms/cms/src/web/Application.php(312): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#12 /app/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#13 /app/web/index.php(23): yii\base\Application->run()
#14 {main}

How can we reproduce this?

  1. Create a form with a couple of fields
  2. Go to the form submissions page
  3. Make a Quick export in Excel format

Freeform Edition

Pro

Freeform Version

5.6.7

Craft Version

5.4.9

When did this issue start?

Unsure

Previous Freeform Version

No response

@smnedelko smnedelko added the issue Something isn't working correctly label Nov 1, 2024
@kjmartens
Copy link
Contributor

Sorry for the delay and the trouble @smnedelko,

I can't duplicate this on my end, but I will have a developer check into it. 🙂

@kjmartens
Copy link
Contributor

This should now be resolved in Freeform 5.7.2+ 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue Something isn't working correctly
Development

Successfully merging a pull request may close this issue.

3 participants